def reshape_decided_failure

bendtorch-core@0.1.0.0 · src/tensor/transform_PROOF.bend:1672

import bendtorch-core@0.1.0.0/src/tensor/transform_PROOF.bend as TransformPROOF
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/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/transforms.bend as Transforms
import bendtorch-core@0.1.0.0/src/tensor/lifecycle.bend as Lifecycle

1672def reshape_decided_failure(+input: Shape.Shape, +target: Shape.Shape,
1673  decision: Shape.BoolCase<Nat.is_eq(Shape.elements(input), Shape.elements(target))>, -source: Core.Tensor<input>,
1674  different: {False{} == Nat.is_eq(Shape.elements(input), Shape.elements(target)) : Bool}) ->
1675  {Transforms.reshape_decided(input, target, source, decision) == Fail{Transforms.LayoutError{Layout.ElementCountMismatch{}}} :
1676    Result<&2, &1, Transforms.Error, Core.Dynamic>}:
1677  match decision:
1678    case Shape.BFalse{equal}:
1679      {==}
1680    case Shape.BTrue{equal}:
1681      Empty.absurd({Transforms.reshape_decided(input, target, source, Shape.BTrue{equal}) == Fail{Transforms.LayoutError{Layout.ElementCountMismatch{}}} :
1682        Result<&2, &1, Transforms.Error, Core.Dynamic>},
1683          Lifecycle.false_true(Equal.trans(Bool, True{}, Nat.is_eq(Shape.elements(input), Shape.elements(target)), False{}, equal,
1684            Equal.sym(Bool, False{}, Nat.is_eq(Shape.elements(input), Shape.elements(target)), different))))

Uses (15)

Used by (1)