def step_indices

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

import bendtorch-core@0.1.0.0/src/tensor/elementwise.bend as Elementwise
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core

167def step_indices(+operation: Operation, -shape: Shape.Shape, +index: U32, state: State<shape>,
168  result: Result<&2, &1, Core.Error, U32 & U32>) -> Step<shape>:
169  State{left, right, output} = state
170  match result:
171    case Fail{error}:
172      Stop{left, right, error}
173    case Done{indices}:
174      (left_index, right_index) = indices
175      step_left(operation, shape, index, right, output, right_index, Core.read_dynamic(left, left_index))

Uses (11)

Used by (4)