def bound
import bendtorch-core@0.1.0.0/src/tensor/signed.bend as Signedimport Base
import bendtorch-core@0.1.0.0/src/tensor/slice.bend as Slice
299# PyTorch's slice positions (aten::slice, get_slice_bounds) before its clamp
300# to the axis: a negative position d becomes d + limit, the wrap, and one
301# still below 0 becomes 0. First{k} stays k; Slice.bounds then clamps both
302# ends to the extent.
303def bound(+limit: U32, +position: Position) -> U32:
304 Bool.pick(U32, before(limit, position), 0, wrap(limit, position))
Uses (5)
Used by (7)
- bendtorch-core@0.1.0.0/src/tensor/signed:slice
- bendtorch-core@0.1.0.0/src/autograd/tensor_backward:slice_axis_plan
- bendtorch-core@0.1.0.0/src/tensor/signed_PROOF:bound_inside
- bendtorch-core@0.1.0.0/src/tensor/signed_LAWS:signed_bound_first
- bendtorch-core@0.1.0.0/src/tensor/signed_LAWS:signed_bound_last_inside
- …