You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/02/25 20:19:19 UTC

[GitHub] [tvm] alexwong commented on a change in pull request #7517: [Torch] Pool ops, convert strides and pool_size to int

alexwong commented on a change in pull request #7517:
URL: https://github.com/apache/tvm/pull/7517#discussion_r583140165



##########
File path: python/tvm/relay/frontend/pytorch.py
##########
@@ -1322,6 +1332,16 @@ def avg_pool2d(self, inputs, input_types):
         ceil_mode = int(inputs[4])
         count_include_pad = int(inputs[5])
 
+        if isinstance(pool_size, list):
+            for i in range(len(pool_size)):
+                if isinstance(pool_size[i], _expr.Constant):
+                    pool_size[i] = int(_infer_value_simulated(pool_size[i], {}).asnumpy())
+
+        if isinstance(strides, list):
+            for i in range(len(strides)):
+                if isinstance(strides[i], _expr.Constant):
+                    strides[i] = int(_infer_value_simulated(strides[i], {}).asnumpy())
+

Review comment:
       Done. Thanks. Changed to any type of expr as well.




----------------------------------------------------------------
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:
users@infra.apache.org