def refused
import bendtorch-core@0.1.0.0/src/autograd/sum_dims.bend as SumDimsimport Base
import bendtorch-core@0.1.0.0/src/tensor/layout.bend as Layout
75# PyTorch's refusal of the axes, permute's checks in permute's order: an axis
76# at or past the limit, then an axis listed twice.
77def refused(bounded: Bool, unique: Bool) -> Maybe<&2, Layout.Error>:
78 match bounded unique:
79 case False{} unique:
80 Some{Layout.AxisOutOfBounds{}}
81 case True{} False{}:
82 Some{Layout.DuplicateAxis{}}
83 case True{} True{}:
84 None{}