src/tensor/contracts/pointwise_records.bend checks
raw source on the hub · import bendtorch-core@0.1.0.0/src/tensor/contracts/pointwise_records.bend as Pointwise_records
4 imports
import Base import ../../shape/core.bend as Shape import ../core.bend as Core import ./pointwise.bend as Pointwise
Types
type PointwiseContract source · line 10 · raw
@-shape:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @-left:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @-right:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @-cell:(@_:Nat -> F32) -> @-left_word:(@_:U32 -> F32) -> @-right_word:(@_:U32 -> F32) -> @-result:Pair(Pair(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/core.Dynamic, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/core.Dynamic), Result<&2, &1, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/core.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/core.Dynamic>) -> Type
What a pointwise result promises, stated only through the result: success,
the output dimensions, cell(i) at every in-bounds output index, and the
words both returned inputs still hold. cell, left_word and right_word
are the specification; an instance fills them in.
PointwiseContract@-shape:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @-left:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @-right:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @-cell:(@_:Nat -> F32) -> @-left_word:(@_:U32 -> F32) -> @-right_word:(@_:U32 -> F32) -> @-result:Pair(Pair(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/core.Dynamic, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/core.Dynamic), Result<&2, &1, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/core.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/core.Dynamic>) -> @successful:{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/contracts/pointwise.succeeded(result) == True{} : Bool} -> @dimensions:{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/contracts/pointwise.output_dimensions(result) == Some{0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(shape)} : Maybe<&2, List<&2, U32>>} -> @value:(@+index:U32 -> @inside:{Nat.is_lt(U32.to_nat(index), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.logical_numel(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(shape))) == True{} : Bool} -> {0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/contracts/pointwise.output_point(result, index) == Some{cell(U32.to_nat(index))} : Maybe<&2, F32>}) -> @left_kept:(@+other:U32 -> @inside:{Nat.is_lt(U32.to_nat(other), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.logical_numel(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(left))) == True{} : Bool} -> {0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/contracts/pointwise.left_point(result, other) == Some{left_word(other)} : Maybe<&2, F32>}) -> @right_kept:(@+other:U32 -> @inside:{Nat.is_lt(U32.to_nat(other), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.logical_numel(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(right))) == True{} : Bool} -> {0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/contracts/pointwise.right_point(result, other) == Some{right_word(other)} : Maybe<&2, F32>}) -> PointwiseContract<shape, left, right, cell, left_word, right_word, result>