apivovarov commented on a change in pull request #4510: Fix TF resize for 
dynamic size models
URL: https://github.com/apache/incubator-tvm/pull/4510#discussion_r357465558
 
 

 ##########
 File path: python/tvm/relay/frontend/tensorflow.py
 ##########
 @@ -416,9 +416,11 @@ def _impl(inputs, attr, params):
                        extras={'axis': int(axis), 'num_newaxis': 1})(inputs, 
attr)
     return _impl
 
-def _resize_bilinear(bilinear_op):
+def _resize(method):
     def _impl(inputs, attr, params):
-        size = attr['_output_shapes'][0][1:3]
+        output_shape0 = attr['_output_shapes'][0]
+        # Dynamic size models might have _output_shapes attr equal to [None] 
here
+        size = output_shape0[1:3] if output_shape0 is not None else [-1]
 
 Review comment:
   I added test case for the case when placeholder has undefined shape in TF 
graph (`placeholder(shape=None)`). In that case `output_shape0` is 
`[-1,-1,-1,-1]` but now 'None'. At least this test tests the code fork which 
calls `_infer_value`

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