Signed.bound: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/signed.bend as Signed Lines 299-304 of bendtorch-core@0.1.0.0/src/tensor/signed.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/signed.bend&start_line=299&end_line=304 import Base import bendtorch-core@0.1.0.0/src/tensor/slice.bend as Slice # PyTorch's slice positions (aten::slice, get_slice_bounds) before its clamp # to the axis: a negative position d becomes d + limit, the wrap, and one # still below 0 becomes 0. First{k} stays k; Slice.bounds then clamps both # ends to the extent. def bound(+limit: U32, +position: Position) -> U32: Bool.pick(U32, before(limit, position), 0, wrap(limit, position)) Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/signed.bend&name=Position https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/signed.bend&name=before https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/signed.bend&name=wrap