def read_result_keeps_projection
bendtorch-core@0.1.0.0 · src/tensor/core.bend:211
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
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/tensor/lifecycle.bend as Lifecycle
211def read_result_keeps_projection(-shape: Shape.Shape, -original: Storage.Storage,
212 -valid: {Lifecycle.logical_length(original) == Shape.logical_numel(Shape.dimensions(shape)) : Nat}, +index: U32, +other: U32,
213 pair: Storage.Storage & Result<&2, &2, Storage.Error, F32>,
214 -same: {pair == Storage.get(original, index) : Storage.Storage & Result<&2, &2, Storage.Error, F32>}) ->
215 {retained_read_observe(shape, read_result(shape, original, valid, index, pair, same), other) == Lifecycle.retained_observe(pair, other) : Maybe<&2, F32>}:
216 (storage, result) = pair
217 {==}