diff --git a/src/tensor/constructors.rs b/src/tensor/constructors.rs index 0a18934..c2a5a3a 100644 --- a/src/tensor/constructors.rs +++ b/src/tensor/constructors.rs @@ -33,7 +33,7 @@ impl Tensor { } pub fn full(n: T, shape: Vec) -> Self { - assert!(shape.len() > 0, "Cannot create a zero-dimension tensor!"); + assert!(!shape.is_empty(), "Cannot create a zero-dimension tensor!"); let vector_ns = vec![n; shape.iter().product()];