def input_point
bendtorch-core@0.1.0.0 · src/tensor/contracts/pointwise_proof.bend:457
import bendtorch-core@0.1.0.0/src/tensor/contracts/pointwise_proof.bend as PointwiseProof
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/storage/LAWS.bend as StorageLaws
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/lifecycle.bend as Lifecycle
import bendtorch-core@0.1.0.0/src/tensor/contracts/replayed.bend as Replayed
import bendtorch-core@0.1.0.0/src/tensor/contracts/pointwise.bend as Pointwise
457def input_point(~P: Data, ~map: P -> Nat -> Nat, +plan: P, +count: Nat, +shape: Shape.Shape, +fill: F32, +ops: List<&2, StorageLaws.Op>,
458 -fits: {Lifecycle.logical_length(input_storage(~P, ~map, plan, shape, fill, ops, count)) == Shape.logical_numel(Shape.dimensions(shape)) : Nat},
459 +index: U32, inside: {Nat.is_lt(U32.to_nat(index), Shape.logical_numel(Shape.dimensions(shape))) == True{} : Bool}) ->
460 {Core.dynamic_read_value(Core.read_dynamic(Core.Packed{shape, Core.TTensor{input_storage(~P, ~map, plan, shape, fill, ops, count), fits}}, index)) ==
461 Some{Replayed.value(shape, fill, ops, index)} : Maybe<&2, F32>}:
462 +seen = List.append(&2, StorageLaws.Op, ops, Pointwise.reads(~P, ~map, plan, count))
463 Equal.trans(Maybe<&2, F32>,
464 Core.dynamic_read_value(Core.read_dynamic(Core.Packed{shape, Core.TTensor{Replayed.storage(shape, fill, seen), fits}}, index)),
465 Some{Replayed.value(shape, fill, seen, index)}, Some{Replayed.value(shape, fill, ops, index)},
466 replayed_point(shape, fill, seen, fits, index, inside),
467 Equal.cong(F32, Maybe<&2, F32>, word => Some{word}, Replayed.value(shape, fill, seen, index), Replayed.value(shape, fill, ops, index),
468 value_reads(~P, ~map, plan, count, shape, fill, ops, index)))