ganler commented on code in PR #11174:
URL: https://github.com/apache/tvm/pull/11174#discussion_r861375353
##########
python/tvm/relay/frontend/onnx.py:
##########
@@ -324,6 +324,9 @@ def flatten_to_nd(x, x_shape, nd=3):
0,
)
return _op.reshape(output, fold_constant(final_shape))
+ elif a_rank == 1:
+ return _op.multiply(inputs[0], inputs[1])
Review Comment:
In
[ONNX](https://github.com/onnx/onnx/blob/main/docs/Changelog.md#MatMul-13)'s
spec, it says it simply follows numpy (PyTorch also largely follows numpy).
In NumPy's
[doc](https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.matmul.html),
there is one case:
> If the first argument is 1-D, it is promoted to a matrix by prepending a 1
to its dimensions. After matrix multiplication the prepended 1 is removed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]