def holds_zero
import bendtorch-core@0.1.0.0/src/tensor/slice.bend as Sliceimport Base
103# Whether some dimension is 0, so the input has no element.
104def holds_zero(dimensions: List<&2, U32>) -> Bool:
105 match dimensions:
106 case Nil{}:
107 False{}
108 case extent <> rest:
109 Bool.or(Nat.is_eq(U32.to_nat(extent), 0n), holds_zero(rest))