PermuteValues.transpose_route: def of bendtorch-core@0.1.0.0
Import: import bendtorch-core@0.1.0.0/src/tensor/permute_values.bend as PermuteValues
Lines 427-437 of bendtorch-core@0.1.0.0/src/tensor/permute_values.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/permute_values.bend&start_line=427&end_line=437
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith
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/transforms.bend as Transforms
import bendtorch-core@0.1.0.0/src/tensor/transpose_spec.bend as Transpose
def transpose_route(+input: Shape.Shape, +a: U32, +b: U32, source: Core.Tensor,
decision: Shape.BoolCase, +inside: {True{} == Transpose.valid(input, a, b) : Bool}) ->
{Transforms.permute_copy(input, source, Layout.transpose_axes(Shape.dimensions(input), a, b, 0)) == Transforms.transpose_decided(input, source, a, b, decision) :
Core.Tensor & Result<&2, &1, Transforms.Error, Core.Dynamic>}:
match decision:
case Shape.BFalse{equal}:
Empty.absurd({Transforms.permute_copy(input, source, Layout.transpose_axes(Shape.dimensions(input), a, b, 0)) ==
(source, Fail{Transforms.LayoutError{Layout.AxisOutOfBounds{}}}) : Core.Tensor & Result<&2, &1, Transforms.Error, Core.Dynamic>},
Arith.clash(Equal.trans(Bool, False{}, Transpose.valid(input, a, b), True{}, equal, Equal.sym(Bool, True{}, Transpose.valid(input, a, b), inside))))
case Shape.BTrue{equal}:
{==}
Uses (20):
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Empty.absurd
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.trans
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=BoolCase
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=Shape
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=dimensions
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/arith.bend&name=clash
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/core.bend&name=Dynamic
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/core.bend&name=Tensor
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/layout.bend&name=Error
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/layout.bend&name=transpose_axes
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/transforms.bend&name=Error
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/transforms.bend&name=permute_copy
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/transforms.bend&name=transpose_decided
https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/transpose_spec.bend&name=valid