def stretched
bendtorch-core@0.1.0.0 · src/tensor/batched_matmul.bend:75
import bendtorch-core@0.1.0.0/src/tensor/batched_matmul.bend as BatchedMatmul
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
75
76
77def stretched(+l: U32, +r: U32, same: Bool, left_one: Bool, right_one: Bool) -> Result<&2, &2, Matrix.Error, U32>:
78 match same left_one right_one:
79 case True{} _ _:
80 Done{l}
81 case False{} True{} _:
82 Done{r}
83 case False{} False{} True{}:
84 Done{l}
85 case False{} False{} False{}:
86 Fail{Matrix.ShapeError{Shape.IncompatibleBroadcast{}}}