Lowering of Recurrent Units with Batch being outer dim
Currently the ONNX definition of LSTM/GRU/RNN define input and output tensors such that batch dimension is NOT the outermost dimension and this is somewhat different than how batch dimension is placed for the rest of the operators- https://github.com/onnx/onnx/blob/master/docs/Operators.md#RNN https://github.com/onnx/onnx/blob/master/docs/Operators.md#LSTM https://github.com/onnx/onnx/blob/master/docs/Operators.md#GRU After lowering this "odd" placement gets inherited by all the lowered nodes too. I would like to introduce an option to perform an alternate lowering where transposes are introduced at the beginning and at the end of LSTM/GRU/RNN so that all the lowered nodes have batch along the outer dimension. Would this be something that might be useful for wider audience? If so I can plan to upstream it.
@jfix71 @rdzhabarov Can you please share your feedback?
Hi @ksaurabh-cadence, it sounds like a reasonable plan. I am not sure how many others may be interested, but we'd be happy to review/land it if upstreamed.
@jfix71 Thanks I will prepare an MR once ready.