We get the following error for compiling bidaf-9 by the latest main branch ( cd7cf7eef3d045c63732731929ba2867a804c6c5 ), because one CategoryMaper has rank-4 input tensor.
Error Message
./build/Debug/bin/onnx-mlir -mcpu=z14 --EmitONNXIR bidaf-9.onnx
loc("CategoryMapper_5"): error: 'onnx.CategoryMapper' op input rank must be one or two
CategoryMapper op in bidaf-9 causing the error (Rank of input is 4)
ai.onnx.ml.CategoryMapper
Converts strings to integers and vice versa.
...
Inputs
X : T1
Input data
Outputs
Y : T2
Output data. If strings are input, the output values are integers, and vice versa.
Type Constraints
T1 : tensor(string), tensor(int64)
The input must be a tensor of strings or integers, either [N,C] or [C].
T2 : tensor(string), tensor(int64)
The output is a tensor of strings or integers. Its shape will be the same as the input shape.
How should onnx-mlir support Bidaf-9?
Although the rank3+ inputs are illegal, onnx-mlir can handle any rank(shape) of input, because it simply sets shape of the input as shape of the output.
We get the following error for compiling bidaf-9 by the latest main branch ( cd7cf7eef3d045c63732731929ba2867a804c6c5 ), because one CategoryMaper has rank-4 input tensor.
Error Message
CategoryMapper op in bidaf-9 causing the error (Rank of input is 4)
In the definition of the ( https://github.com/onnx/onnx/blob/main/docs/Operators-ml.md#ai.onnx.ml.CategoryMapper ), the input tensor's rank should be [N,C] or [C], so that rank should 1 or 2.
CategoryMapper op definition
How should onnx-mlir support Bidaf-9? Although the rank3+ inputs are illegal, onnx-mlir can handle any rank(shape) of input, because it simply sets shape of the input as shape of the output.