def axis_of

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

import bendtorch-core@0.1.0.0/src/tensor/signed_LAWS.bend as SignedLAWS
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
import bendtorch-core@0.1.0.0/src/tensor/elementwise_totality.bend as Totality
import bendtorch-core@0.1.0.0/src/tensor/signed.bend as Signed

314# Signed slicing (Signed.slice, narrow and select). The axis is wrapped among
315# the input's rank, as every other signed axis; the positions along it among
316# its extent, each as PyTorch takes it.
317def axis_of(input: Core.Dynamic, dim: Signed.Position) -> U32:
318  Signed.wrap(Shape.rank(Totality.dynamic_shape(input)), dim)

Uses (6)

Used by (6)