def refused

bendtorch-core@0.1.0.0 · src/tensor/slice.bend:162

import bendtorch-core@0.1.0.0/src/tensor/slice.bend as Slice
import 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)