Skip to content

Commit

Permalink
Addressed warning of comparing length of array to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Aman-Amith-Shastry committed Dec 16, 2024
1 parent 7d42c49 commit aa5e061
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tensor/constructors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl<T: RawDataType> Tensor<T> {
}

pub fn full(n: T, shape: Vec<usize>) -> 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()];

Expand Down

0 comments on commit aa5e061

Please sign in to comment.