soiferj commented on a change in pull request #4483: [WIP][relay][op] add 
expand op (from ONNX) to relay frontend
URL: https://github.com/apache/incubator-tvm/pull/4483#discussion_r356201012
 
 

 ##########
 File path: python/tvm/relay/frontend/onnx.py
 ##########
 @@ -1080,6 +1080,18 @@ class Or(Elemwise):
     def _impl_v7(cls, inputs, attr, params):
         return _op.logical_or(inputs[0], inputs[1])
 
+class Expand(OnnxOpConverter):
+    """ Operator converter for Expand.
+    """
+
+    @classmethod
+    def _impl_v1(cls, inputs, attr, params):
+        assert len(inputs) == 2, "ONNX Expand must have 2 inputs."
+        assert isinstance(inputs[1], tvm.relay.expr.Var), "2nd operand of ONNX 
Expand must be a constant."
 
 Review comment:
   I don't think we need to assert that it's a constant. We can use 
`_infer_value_simulated` to get the value if it's not. This is required for 
some of the BERT models I've been testing.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to