def product_output

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

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

759def product_output(-lo: Order, -ro: Order, -left: Shape.Shape, -right: Shape.Shape, +rows: U32, +inner: U32,
760  +right_inner: U32, +columns: U32,
761  -le: {Shape.dimensions(left) == arranged(lo, rows, inner) : List<&2, U32>},
762  -re: {Shape.dimensions(right) == arranged(ro, columns, right_inner) : List<&2, U32>},
763  -compatible: {U32.to_nat(inner) == U32.to_nat(right_inner) : Nat},
764  result: Shape.ConstructResult<[rows, columns]>) -> Result<&2, &2, Error, Product<lo, ro, left, right>>:
765  match result:
766    case Shape.SError{error}:
767      Fail{ShapeError{error}}
768    case Shape.SBuilt{shape, preserved}:
769      Done{Product{shape, rows, inner, right_inner, columns, le, re, preserved, compatible}}

Uses (12)

Used by (2)