Skip to content

Commit

Permalink
Fix how we check for zero-element arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
shwina committed Jan 3, 2025
1 parent 8b1fdd9 commit cc8a9fa
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def is_contiguous(arr: DeviceArrayLike) -> bool:
if strides is None:
return True

if sum(shape) == 0:
if any(dim == 0 for dim in shape):
# array has no elements
return True

Expand Down

0 comments on commit cc8a9fa

Please sign in to comment.