Repository: coreylowman/dfdx (language: rust)

Issue:
Clarify behavior of reshape when data is contiguous vs not-contiguous
Need to add details to ReshapeTo trait that:
1. If input tensor is contiguous, no copying occurs
2. If input tensor is NOT contiguous (i.e. permuted or broadcasted), then copying DOES occur


Discussion / hints:

Fix patch:
diff --git a/src/tensor_ops/reshape_to/mod.rs b/src/tensor_ops/reshape_to/mod.rs
index 5dfa07fcd..9f40fcb30 100644
--- a/src/tensor_ops/reshape_to/mod.rs
+++ b/src/tensor_ops/reshape_to/mod.rs
@@ -20,7 +20,9 @@ pub trait ReshapeKernel<E: Dtype>: DeviceStorage {
     ) -> Result<(), Self::Err>;
 }
 
-/// Change the shape of a tensor moving data around.
+/// Changes the shape of a tensor without re-ordering axes. If the tensor is contiguous
+/// already, then no data movement will occur. If the tensor is not contiguous, the
+/// result of this will be contiguous.
 ///
 /// Compile time reshapes:
 /// ```rust


Test patch: