def created_status

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

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/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/matmul.bend as Matrix
import bendtorch-core@0.1.0.0/src/tensor/math_totality.bend as Totality
import bendtorch-core@0.1.0.0/src/tensor/word_conversion.bend as Conversion
import bendtorch-core@0.1.0.0/src/tensor/allocation_spec.bend as Allocation

989def created_status(+left: Shape.Shape, +right: Shape.Shape, +output: Shape.Shape, +rows: U32, +inner: U32, +right_inner: U32, +columns: U32,
990  result: Result<&2, &1, Core.Error, Core.Tensor<output>>, a: Core.Tensor<left>, b: Core.Tensor<right>,
991  -done: Allocation.TensorDone<output, result>,
992  -le: {Shape.dimensions(left) == [rows, inner] : List<&2, U32>}, -re: {Shape.dimensions(right) == [right_inner, columns] : List<&2, U32>},
993  -oe: {Shape.dimensions(output) == [rows, columns] : List<&2, U32>}, -compatible: {U32.to_nat(inner) == U32.to_nat(right_inner) : Nat}) ->
994  Totality.Status<Matrix.Error, Core.Tensor<left> & Core.Tensor<right> & Core.Tensor<output>, Matrix.created(left, right, output, inner, columns, a, b, result)>:
995  match result:
996    case Fail{error}:
997      Totality.Status{{\{Allocation.TensorDone: tensor => exact =>
998        Empty.absurd({False{} == True{} : Bool}, Shape.clash(Equal.cong(Result<&2, &1, Core.Error, Core.Tensor<output>>, Bool,
999          Result.is_done(&2, &1, Core.Error, Core.Tensor<output>), Done{tensor}, Fail{error}, exact)))} :
1000            Allocation.TensorDone<output, Fail{error}> -> {False{} == True{} : Bool}}(done)}
1001    case Done{out}:
1002      product_loop_status(Shape.elements(output), left, right, output, rows, inner, right_inner, columns, 0n, a, b, out, le, re, oe, compatible,
1003        %Equal.sym(Nat, Nat.add(Shape.elements(output), 0n), Shape.elements(output), add_zero(Shape.elements(output))) : Shape.LE(_, Shape.elements(output))
1004        Shape.LE.from(Shape.elements(output), Shape.elements(output), Equal.sym(Bool, Nat.is_le(Shape.elements(output), Shape.elements(output)), True{}, Conversion.le_reflexive(Shape.elements(output)))))

Uses (28)

Used by (1)