def count_exact

bendtorch-core@0.1.0.0 · src/tensor/construction_contract_PROOF.bend:33

import bendtorch-core@0.1.0.0/src/tensor/construction_contract_PROOF.bend as ConstructionContractPROOF
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/word_conversion.bend as Conversion

33def count_exact(+shape: Shape.Shape) ->
34  {U32.to_nat(Shape.count(shape)) == Shape.logical_numel(Shape.dimensions(shape)) : Nat}:
35  Equal.trans(Nat, U32.to_nat(Shape.count(shape)), Shape.elements(shape), Shape.logical_numel(Shape.dimensions(shape)),
36    Conversion.shape_count_exact(shape), Shape.elements_exact(shape))

Uses (10)

Used by (2)