def owned_read_keeps

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

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

528def owned_read_keeps(-shape: Shape.Shape, +depth: Nat, +length: Nat, -array: Array<F32>, +index: U32,
529  -balanced: Model.Balanced(F32, depth, array), -valid: {Storage.bounds(depth, length) == True{} : Bool},
530  -exact: {length == Shape.logical_numel(Shape.dimensions(shape)) : Nat}) ->
531  SourceReadKeeps<shape, TTensor{Storage.Owned{depth, length, array, balanced, valid}, exact}, index>:
532  storage_read_keeps_source(shape, Storage.Owned{depth, length, array, balanced, valid}, exact, index,
533    Lifecycle.read_checked_storage_keeps(depth, length, array, index, balanced, valid,
534      Lifecycle.read_checked_keeps(depth, length, array, index, Nat.is_lt(U32.to_nat(index), length), {==}, balanced, valid)))

Uses (18)

Used by (1)