def transpose_failure
bendtorch-core@0.1.0.0 · src/tensor/permute_contract.bend:117
import bendtorch-core@0.1.0.0/src/tensor/permute_contract.bend as PermuteContract
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/shape/nat_proofs.bend as Nats
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/layout.bend as Layout
import bendtorch-core@0.1.0.0/src/tensor/transpose_spec.bend as Transpose
import bendtorch-core@0.1.0.0/src/tensor/transforms.bend as Transforms
117def transpose_failure(+input: Shape.Shape, -tensor: Core.Tensor<input>, +a: U32, +b: U32,
118 decision: Shape.BoolCase<Transpose.valid(input, a, b)>, outside: {Transpose.valid(input, a, b) == False{} : Bool}) ->
119 {Transforms.transpose_decided(input, tensor, a, b, decision) == (tensor, Fail{Transforms.LayoutError{Layout.AxisOutOfBounds{}}}) : Core.Tensor<input> & Result<&2, &1, Transforms.Error, Core.Dynamic>}:
120 match decision:
121 case Shape.BFalse{no}:
122 {==}
123 case Shape.BTrue{yes}:
124 Empty.absurd({Transforms.transpose_decided(input, tensor, a, b, Shape.BTrue{yes}) == (tensor, Fail{Transforms.LayoutError{Layout.AxisOutOfBounds{}}}) : Core.Tensor<input> & Result<&2, &1, Transforms.Error, Core.Dynamic>},
125 Nats.contradiction(Transpose.valid(input, a, b), yes, Equal.sym(Bool, Transpose.valid(input, a, b), False{}, outside)))