def owned_read_source
bendtorch-core@0.1.0.0 · src/tensor/core.bend:520
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/storage/model.bend as Model
import bendtorch-core@0.1.0.0/src/tensor/lifecycle.bend as Lifecycle
520def owned_read_source(-shape: Shape.Shape, +depth: Nat, +length: Nat, -array: Array<F32>, +index: U32,
521 -balanced: Model.Balanced(F32, depth, array), -valid: {Storage.bounds(depth, length) == True{} : Bool},
522 -exact: {length == Shape.logical_numel(Shape.dimensions(shape)) : Nat}) ->
523 SourceRead<shape, TTensor{Storage.Owned{depth, length, array, balanced, valid}, exact}, index>:
524 storage_read_source(shape, Storage.Owned{depth, length, array, balanced, valid}, exact, index,
525 Lifecycle.read_checked_storage(depth, length, array, index, balanced, valid,
526 Lifecycle.read_checked_model(depth, length, array, index, Nat.is_lt(U32.to_nat(index), length), {==}, balanced, valid)))