TensorShape.numel: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/tensor_shape.bend as TensorShape Lines 47-51 of stelliferous@0.0.2.0/tensor_shape.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/tensor_shape.bend&start_line=47&end_line=51 import Base # Scalar [] has one element. Any zero extent makes an empty shape, even when # an earlier partial product would overflow. Nonempty overflow is rejected. def numel(shape: Shape) -> Maybe<&2,U32>: Shape{+extents} = shape count_nonempty(has_zero(extents),extents) Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_shape.bend&name=Shape https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_shape.bend&name=count_nonempty https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_shape.bend&name=has_zero