jwfromm commented on a change in pull request #5135: [ONNX]Pool3d & upsample3d 
op support
URL: https://github.com/apache/incubator-tvm/pull/5135#discussion_r396796126
 
 

 ##########
 File path: python/tvm/relay/frontend/onnx.py
 ##########
 @@ -780,19 +784,36 @@ def _impl_v9(cls, inputs, attr, params):
             assert len(inputs) == 2, "Upsample op take 2 inputs, {} 
given".format(len(inputs))
             scales = params[inputs[1].name_hint].asnumpy()
             inputs = inputs[:1]
-        assert len(scales) == 4 and scales[0] == 1.0 and scales[1] == 1.0
+        assert scales[0] == 1.0 and scales[1] == 1.0
+        input_shape = infer_shape(inputs[0])
+        dims = len(input_shape)
+        isUpSample3D = bool(dims == 5)
 
 Review comment:
   I'm not a big fan of defining a variable for this as just checking `dims == 
5` in line is clear and concise enough. It also makes things cleaner for other 
Nd operator support.

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