-
Notifications
You must be signed in to change notification settings - Fork 639
Description
In the onnx level, I try express matmul of one dim. The mlir is legal that is "torch.operator "onnx.MatMul"(%arg0, %arg1) : (!torch.vtensor<[1],f16>, !torch.vtensor<[1],f16>) -> !torch.vtensor<[1],f16>". But the mlir that is "torch.operator "onnx.MatMul"(%arg0, %arg1) : (!torch.vtensor<[],f16>, !torch.vtensor<[1],f16>) -> !torch.vtensor<[],f16>" is also legal, so when only have one dim, matmulOp's result allow 0 rank and 1 rank.
This lead to a failure when convert AtenMatmulOp. The code location is the "torch-mlir/lib/Conversion/TorchToLinalg/Linear.cpp". The patten transform the matmulOp into a dotOp, which is a 0 rank result by default. If the result is 1 rank in the onnx level, that would be failed.
Should we add verify of the result's dim for the matmul operator?