type ReadContract

bendtorch-core@0.1.0.0 · src/tensor/read_write_records.bend:6

import bendtorch-core@0.1.0.0/src/tensor/read_write_records.bend as ReadWriteRecords
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/observation.bend as Observation

6type ReadContract<-shape: Shape.Shape, -fill: F32, -index: U32, -code: U32> is Type:
7  ReadContract{
8    outcome: {Observation.read_code(shape, index, Core.new(shape, fill)) == Some{code} : Maybe<&2, U32>},
9    retained_dimensions: {Observation.after_dimensions(shape, index, Core.new(shape, fill)) == Some{Shape.dimensions(shape)} : Maybe<&2, List<&2, U32>>},
10    retained_count: {Observation.after_length(shape, index, Core.new(shape, fill)) == Some{Shape.logical_numel(Shape.dimensions(shape))} : Maybe<&2, Nat>},
11    retained_word_count: {Observation.after_count(shape, index, Core.new(shape, fill)) == Some{Shape.count(shape)} : Maybe<&2, U32>},
12    retained_value: @+other: U32 -> @inside: {Nat.is_lt(U32.to_nat(other), Shape.logical_numel(Shape.dimensions(shape))) == True{} : Bool} ->
13      {Observation.after_value(shape, index, other, Core.new(shape, fill)) == Some{fill} : Maybe<&2, F32>}}

Uses (18)

Used by (4)