def clamped_stop

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

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

129# The stop after the clamp: the clamped stop, or the clamped start where the
130# clamped stop falls before it, so the axis is empty.
131def clamped_stop(+start: Nat, +stop: Nat, +extent: Nat) -> Nat:
132  Bool.pick(Nat, Nat.is_le(clamp(start, extent), clamp(stop, extent)), clamp(stop, extent), clamp(start, extent))

Uses (4)

Used by (1)