zhang-yi-chi commented on code in PR #12213:
URL: https://github.com/apache/tvm/pull/12213#discussion_r935526678


##########
python/tvm/relay/frontend/onnx.py:
##########
@@ -2756,6 +2757,138 @@ def _activation_needs_beta(cls, activation):
         ]
         return activation.decode("utf-8") in needs_beta
 
+    @classmethod
+    def bidir_rnn_cell(
+        cls,
+        input_seqs,
+        weight_dicts,
+        acts,
+    ):
+        """
+        Bidirectional RNN cell
+        """
+        seq_len = len(input_seqs)
+        forward_outputs, fw_H_t = rnn_cell(
+            input_seqs,
+            **weight_dicts[0],
+            act=acts[0],
+        )
+
+        reverse_outputs, rev_H_t = rnn_cell(
+            input_seqs,
+            **weight_dicts[1],
+            act=acts[1],
+            backwards=True,
+        )
+
+        final_outputs = []
+        for i in range(seq_len):
+            final_outputs.append(
+                _op.stack([forward_outputs[i], reverse_outputs[seq_len - 1 - 
i]], axis=0)
+            )
+
+        return (
+            _op.stack(final_outputs, axis=0),
+            _op.stack([fw_H_t, rev_H_t], axis=0),
+        )
+
+    @classmethod
+    def _impl_v7(cls, inputs, attr, params):

Review Comment:
   Sure. I found that opset 14 has an extra attr `layout` but onnxruntime 
doesn't support `layout == 1`, so I commented out the test for `layout == 1` 
for now.



-- 
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]

Reply via email to