def refused
import bendtorch-core@0.1.0.0/src/tensor/slice.bend as Sliceimport Base
import bendtorch-core@0.1.0.0/src/tensor/layout.bend as Layout
162# PyTorch's checks, in its order: the axis (a rank-0 input has none), then
163# the step.
164def refused(inside: Bool, positive: Bool) -> Maybe<&2, Error>:
165 match inside positive:
166 case False{} _:
167 Some{LayoutError{Layout.AxisOutOfBounds{}}}
168 case True{} False{}:
169 Some{StepNotPositive{}}
170 case True{} True{}:
171 None{}
Uses (4)
Used by (11)
- bendtorch-core@0.1.0.0/src/tensor/slice:refusal
- bendtorch-core@0.1.0.0/src/tensor/signed_LAWS:signed_narrow_before
- bendtorch-core@0.1.0.0/src/tensor/signed_LAWS:signed_narrow_before_axis
- bendtorch-core@0.1.0.0/src/tensor/slice_LAWS:narrow_axis_refused
- bendtorch-core@0.1.0.0/src/tensor/slice_LAWS:narrow_out_of_range
- …