def plan_decided_success

bendtorch-core@0.1.0.0 · src/tensor/permutation_mapping.bend:265

import bendtorch-core@0.1.0.0/src/tensor/permutation_mapping.bend as PermutationMapping
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/layout.bend as Layout
import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith

265def plan_decided_success(+input: Shape.Shape, +axes: List<&2, U32>, decision: Shape.BoolCase<Layout.bijective(input, axes)>,
266  +valid: {True{} == Layout.bijective(input, axes) : Bool}) ->
267  {Result.is_done(&2, &2, Layout.Error, Layout.Plan<input, axes>, Layout.plan_decided(input, axes, decision)) == True{} : Bool}:
268  match decision:
269    case Shape.BFalse{equal}:
270      Empty.absurd({False{} == True{} : Bool},
271        Arith.clash(Equal.trans(Bool, False{}, Layout.bijective(input, axes), True{}, equal,
272          Equal.sym(Bool, True{}, Layout.bijective(input, axes), valid))))
273    case Shape.BTrue{equal}:
274      plan_selected_success(input, axes, equal, Layout.reorder(Shape.dimensions(input), axes), {==})

Uses (17)

Used by (1)