def read_found
bendtorch-core@0.1.0.0 · src/tensor/contracts/replayed.bend:77
import bendtorch-core@0.1.0.0/src/tensor/contracts/replayed.bend as Replayed
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/storage/main.bend as Storage
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/word_conversion.bend as Conversion
import bendtorch-core@0.1.0.0/src/tensor/read_contract.bend as Reads
77def read_found(+shape: Shape.Shape, +fill: F32, +ops: List<&2, StorageLaws.Op>,
78 -valid: {Lifecycle.logical_length(storage(shape, fill, ops)) == Shape.logical_numel(Shape.dimensions(shape)) : Nat}, +index: U32,
79 inside: {Nat.is_lt(U32.to_nat(index), Shape.logical_numel(Shape.dimensions(shape))) == True{} : Bool}) ->
80 {Core.read_value(shape, Core.read_flat(shape, Core.TTensor{storage(shape, fill, ops), valid}, index)) ==
81 Some{value(shape, fill, ops, index)} : Maybe<&2, F32>}:
82 Equal.trans(Maybe<&2, F32>, Core.read_value(shape, Core.read_flat(shape, Core.TTensor{storage(shape, fill, ops), valid}, index)),
83 Lifecycle.read_value(Storage.get(storage(shape, fill, ops), index)), Some{value(shape, fill, ops, index)},
84 Core.read_result_value(shape, storage(shape, fill, ops), valid, index, Storage.get(storage(shape, fill, ops), index), {==}),
85 Reads.stored_value(storage(shape, fill, ops), index, value(shape, fill, ops, index),
86 StorageLaws.replay_get(Shape.count(shape), fill, ops, index, Conversion.shape_count_within(shape),
87 Reads.word_inside(shape, index, inside))))