def core_read_projection

bendtorch-core@0.1.0.0 · src/tensor/elementwise_PROOF.bend:113

import bendtorch-core@0.1.0.0/src/tensor/elementwise_PROOF.bend as ElementwisePROOF
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/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/elementwise_totality.bend as Totality
import bendtorch-core@0.1.0.0/src/tensor/lifecycle.bend as Lifecycle

113def core_read_projection(+shape: Shape.Shape, -original: Storage.Storage,
114  -valid: {Lifecycle.logical_length(original) == Shape.logical_numel(Shape.dimensions(shape)) : Nat}, +index: U32,
115  +property: Totality.Property, pair: Storage.Storage & Result<&2, &2, Storage.Error, F32>,
116  -same: {pair == Storage.get(original, index) : Storage.Storage & Result<&2, &2, Storage.Error, F32>}) ->
117  {Totality.inspect(property, Core.Packed{shape, tensor_read_owner(shape, Core.read_result(shape, original, valid, index, pair, same))}) ==
118    storage_tensor_inspect(shape, property, read_owner(pair)) : Totality.Inspection}:
119  match property:
120    case Totality.Dimensions{}:
121      (storage, result) = pair
122      {==}
123    case Totality.Checked{other}:
124      (storage, result) = pair
125      {==}
126    case Totality.Raw{other}:
127      (storage, result) = pair
128      {==}

Uses (21)

Used by (1)