Comment on the definition of a stride
@@ -77,6 +77,17 @@ public interface Tensor<T> {
long[] getShape();
+ /**
+ * Returns the stride for each dimension of the tensor (based on C ordering).
+ *
+ * The stride is the distance you'd move in a flat representation of the tensor for each index within that dimension
+ * EG) For a 2x2 Tensor the Tensor would be laid out (in C order):
+ * [{0, 0}, {0, 1}, {1. 0}, {1. 1}]
+ * Thus the stride array would be provided as:
+ * [2, 1]
+ *
+ * @return The stride array for this tensor
+ */
long[] getStride();
long getLength();
