def exact_product
import bendtorch-core@0.1.0.0/src/tensor/signed.bend as Signedimport Base
92# The product of the exact sizes, in Nat: what the laws state the inference
93# against. The inference never forms it, since it can pass the native Nat
94# limit of 2^48 on an empty input: [-1, 2^24, 2^24] multiplies to 2^48.
95def exact_product(extents: List<&2, Extent>) -> Nat:
96 match extents:
97 case Nil{}:
98 1n
99 case Exact{+size} <> tail:
100 Nat.mul(U32.to_nat(size), exact_product(tail))
101 case Inferred{} <> tail:
102 exact_product(tail)
Uses (5)
Used by (10)
- bendtorch-core@0.1.0.0/src/tensor/signed_PROOF:capped_classifies
- bendtorch-core@0.1.0.0/src/tensor/signed_PROOF:filled_none
- bendtorch-core@0.1.0.0/src/tensor/signed_PROOF:filled_one
- bendtorch-core@0.1.0.0/src/tensor/signed_LAWS:signed_capped_classifies
- bendtorch-core@0.1.0.0/src/tensor/signed_LAWS:signed_capped_within
- …