def indexed

bendtorch-core@0.1.0.0 · src/autograd/tensor_backward.bend:1589

import bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend as TensorBackward
import Base

1589# Records an index_select or a gather of a copy of a's value as a Gathered
1590# node with a's shape, the plan and the entries. The value is checked first,
1591# so a refusal is the value's: an axis outside -rank..rank-1 is
1592# AxisOutOfBounds (13), an entry at or past the extent OutOfRange (20), a
1593# gather index of another rank IndexRankMismatch (21), with another extent at
1594# another axis IndexShapeMismatch (22), whose entry count is not the product
1595# of its dimensions ValueCountMismatch (10), an unknown id UnknownNode; the
1596# tape comes back unchanged.
1597def indexed(tape: Tape, +a: Nat, +indexing: Indexing) -> Tape & Result<&2, &2, Error, Nat>:
1598  Tape{entries} = tape
1599  gather_found(a, indexing, value_counted(a, counted(entries)))

Uses (9)

Used by (2)