def axis_spec

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

import bendtorch-core@0.1.0.0/src/tensor/slice_LAWS.bend as SliceLAWS
import Base
import bendtorch-core@0.1.0.0/src/tensor/slice.bend as Slice

134# What a request start:stop:step plans along an axis of extent n: the
135# extent, the clamped start, the step, and the length of the clamped range.
136def axis_spec(+extent: Nat, +start: Nat, +stop: Nat, +step: Nat) -> Nat & Nat & Nat & Nat:
137  (extent, clamp(start, extent), step,
138    Slice.length(Slice.Bounds{clamp(start, extent), clamped_stop(start, stop, extent)}, step))

Uses (7)

Used by (3)