def numel

stelliferous@0.0.2.0 · tensor_shape.bend:47

import stelliferous@0.0.2.0/tensor_shape.bend as TensorShape
import Base

47# Scalar [] has one element. Any zero extent makes an empty shape, even when
48# an earlier partial product would overflow. Nonempty overflow is rejected.
49def numel(shape: Shape) -> Maybe<&2,U32>:
50  Shape{+extents} = shape
51  count_nonempty(has_zero(extents),extents)

Uses (5)

Used by (3)