def facts_output
bendtorch-core@0.1.0.0 · src/tensor/contracts/matmul_proof.bend:37
import bendtorch-core@0.1.0.0/src/tensor/contracts/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/matmul.bend as Matrix
37def facts_output(-left: Shape.Shape, -right: Shape.Shape, +rows: U32, +inner: U32, +right_inner: U32, +columns: U32,
38 le: {Shape.dimensions(left) == [rows, inner] : List<&2, U32>},
39 re: {Shape.dimensions(right) == [right_inner, columns] : List<&2, U32>},
40 compatible: {U32.to_nat(inner) == U32.to_nat(right_inner) : Nat},
41 result: Shape.ConstructResult<[rows, columns]>) ->
42 Facts(left, right, Matrix.plan_output(left, right, rows, inner, right_inner, columns, le, re, compatible, result)):
43 match result:
44 case Shape.SError{error}:
45 Unit{}
46 case Shape.SBuilt{shape, preserved}:
47 MatrixFacts{le, re, preserved, compatible}