def ObservationChecked

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

import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import Base
import bendtorch-core@0.1.0.0/src/storage/main.bend as Storage

45def ObservationChecked(dynamic: Dynamic, -index: U32) -> Data:
46  Packed{shape, tensor} = dynamic
47  TTensor{storage, exact} = tensor
48  match storage:
49    case Storage.Empty{}:
50      Empty
51    case Storage.Owned{+depth, +length, array, balanced, valid}:
52      {Storage.index_matches(depth, length, index) == True{} : Bool}

Uses (7)

Used by (55)