summaryrefslogtreecommitdiff
path: root/src/tensor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tensor.rs')
-rw-r--r--src/tensor.rs9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/tensor.rs b/src/tensor.rs
index a1262334..02105573 100644
--- a/src/tensor.rs
+++ b/src/tensor.rs
@@ -310,14 +310,7 @@ impl Tensor {
}
pub fn is_contiguous(&self) -> bool {
- let mut acc = 1;
- for (&stride, &dim) in self.stride.iter().zip(self.shape.dims().iter()).rev() {
- if stride != acc {
- return false;
- }
- acc *= dim;
- }
- true
+ self.shape.is_contiguous(&self.stride)
}
/// Return all the nodes that lead to this value in a topologically sorted vec, the first