-
The stride will have the same number of values as the number of dimensions. E.g. if you are dealing with a tensor with 4 dimensions,
tensor.stride()
will return 4 values. -
Yes, that’s correct and this post gives another example with contiguous vs. non-contiguous tensors.
-
The stride is used in the backend for indexing, which can be used if you want to directly access specific elements in the memory block.
5 Likes