This PR changes the existing ewBinaryOp codegen to broadcast rhs if possible.
So far, the ewBinary codegen only accepted scalars, matrices of equal shape or combinations of lhs being a matrix and rhs being either a scalar or singleton.
Now rhs can also be given as a matching (equal to lhs in one dimension and size 1 in the other) row or column vector.
An example script (--explain mlir_codegen is optional to show the generated IR):
This PR changes the existing ewBinaryOp codegen to broadcast
rhs
if possible. So far, the ewBinary codegen only accepted scalars, matrices of equal shape or combinations oflhs
being a matrix andrhs
being either a scalar or singleton. Nowrhs
can also be given as a matching (equal tolhs
in one dimension and size1
in the other) row or column vector.An example script (--explain mlir_codegen is optional to show the generated IR):
A more thorough description will be given once some tests have been added.