masahi commented on a change in pull request #9113:
URL: https://github.com/apache/tvm/pull/9113#discussion_r717522882



##########
File path: python/tvm/relay/frontend/onnx.py
##########
@@ -1279,6 +1293,16 @@ def _impl_v1(cls, inputs, attr, params):
         return inputs[len(inputs) - 1]
 
 
+class SequenceConstruct(OnnxOpConverter):
+    """Operator converter for SequenceConstruct"""
+
+    @classmethod
+    def _impl_v11(cls, inputs, attr, params):
+        if len(inputs) == 1:
+            raise ValueError("Expect 2 or more inputs")
+        return _op.Tuple(inputs)

Review comment:
       With Sequence, we need to able to an insert element into an existing 
Sequence, see 
https://github.com/onnx/onnx/blob/master/docs/Operators.md#SequenceInsert. This 
cannot be done with Tuple, since the number of elements in a Tuple is fixed. 
   
   The usage of tensor array is very complicated. So unless you know what you 
are really doing, I don't recommend tackling `Sequence` op for now. 
   
   TensorArray is defined here 
https://github.com/apache/tvm/blob/dd7d830a4ded642ff9d1dbbc7ee9481dc5c2100b/python/tvm/relay/prelude.py#L123.
 For example, `ConcatFromSequence` should convert to `tensor_concatenate`, and 
`SequenceInsert` should map to `tensor_array_write`.
   
   You can look at its usage in the pytorch frontend. But frankly I don't 
remember how I got tensor array support working for the PT frontend.




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