def plan_output

bendtorch-core@0.1.0.0 · src/tensor/matmul.bend:27

import bendtorch-core@0.1.0.0/src/tensor/matmul.bend as Matmul
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape

27def plan_output(-left: Shape.Shape, -right: Shape.Shape, +rows: U32, +inner: U32,
28  +right_inner: U32, +columns: U32,
29  -le: {Shape.dimensions(left) == [rows, inner] : List<&2, U32>},
30  -re: {Shape.dimensions(right) == [right_inner, columns] : List<&2, U32>},
31  -compatible: {U32.to_nat(inner) == U32.to_nat(right_inner) : Nat},
32  result: Shape.ConstructResult<[rows, columns]>) -> Result<&2, &2, Error, Plan<left, right>>:
33  match result:
34    case Shape.SError{error}:
35      Fail{ShapeError{error}}
36    case Shape.SBuilt{shape, preserved}:
37      Done{Plan{shape, rows, inner, right_inner, columns, le, re, preserved, compatible}}

Uses (10)

Used by (3)