Returns the jump necessary to go from one element to the next one in each dimension. Example:
> x = torch.Tensor(4,5):zero() > print(x) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [torch.Tensor of dimension 4x5] > return x:stride() 1 -- elements are contiguous in a column [first dimension] 4 [torch.LongStorage of size 2]
Note also that in Torch
elements in the same column [elements along the first dimension]
are contiguous in memory for a matrix [tensor].