def plan_compatible_status

bendtorch-core@0.1.0.0 · src/tensor/matmul_PROOF.bend:1029

import bendtorch-core@0.1.0.0/src/tensor/matmul_PROOF.bend as MatmulPROOF
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/lifecycle.bend as Lifecycle
import bendtorch-core@0.1.0.0/src/tensor/matmul.bend as Matrix
import bendtorch-core@0.1.0.0/src/tensor/reduction_PROOF.bend as MathProof
import bendtorch-core@0.1.0.0/src/shape/LAWS.bend as ShapeLaws

1029def plan_compatible_status(+left: Shape.Shape, +right: Shape.Shape, +rows: U32, +inner: U32, +right_inner: U32, +columns: U32,
1030  decision: Shape.BoolCase<Nat.is_eq(U32.to_nat(inner), U32.to_nat(right_inner))>,
1031  -le: {Shape.dimensions(left) == [rows, inner] : List<&2, U32>}, -re: {Shape.dimensions(right) == [right_inner, columns] : List<&2, U32>},
1032  -compatible: {U32.to_nat(inner) == U32.to_nat(right_inner) : Nat}, -supported: Shape.LE(Shape.logical_numel([rows, columns]), 1048576n)) ->
1033  PlanStatus<left, right, Matrix.plan_compatible(left, right, rows, inner, right_inner, columns, le, re, decision)>:
1034  match decision:
1035    case Shape.BFalse{equal}:
1036      PlanStatus{Empty.absurd({False{} == True{} : Bool}, MathProof.conversion_clash(U32.to_nat(inner), U32.to_nat(right_inner), compatible, equal))}
1037    case Shape.BTrue{equal}:
1038      plan_output_status(left, right, rows, inner, right_inner, columns, Shape.construct([rows, columns]), le, re,
1039        Lifecycle.natural_equal(U32.to_nat(inner), U32.to_nat(right_inner), equal),
1040        ShapeLaws.construction_complete([rows, columns], Unit{}, supported))

Uses (20)

Used by (1)