def plan_left

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

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

65def plan_left(+left: Shape.Shape, +right: Shape.Shape, dimensions: List<&2, U32>,
66  -same: {dimensions == Shape.dimensions(left) : List<&2, U32>}) ->
67  Result<&2, &2, Error, Plan<left, right>>:
68  match dimensions:
69    case +rows <> +inner <> Nil{}:
70      plan_right(left, right, rows, inner,
71        Equal.sym(List<&2, U32>, [rows, inner], Shape.dimensions(left), same),
72        Shape.dimensions(right), {==})
73    case rest:
74      Fail{RankMismatch{}}

Uses (9)

Used by (9)