AndrewZhaoLuo commented on code in PR #14740:
URL: https://github.com/apache/tvm/pull/14740#discussion_r1180658694


##########
python/tvm/relay/frontend/onnx.py:
##########
@@ -1988,14 +1988,15 @@ def _impl_v1(cls, inputs, attr, params):
         data = inputs[0]
         input_shape = infer_shape(data)
         ndim = len(input_shape)
+        num_spatial_dims = ndim - 2
         if "auto_pad" in attr:
             attr["auto_pad"] = attr["auto_pad"].decode("utf-8")
             if attr["auto_pad"] in ("SAME_UPPER", "SAME_LOWER"):
                 # Warning: LpPool does not yet support dynamic shapes,
                 # one will need to run dynamic_to_static on this model after 
import
                 data = autopad(
                     data,
-                    attr["strides"],
+                    attr.get("strides", [1] * num_spatial_dims),

Review Comment:
   `_impl_v1` implies a handling of the v1 version of the opset. This is 
technically 11+. 
   
   I think the pattern here is this is ok, as creating a `_impl_v11` implies 
significant interface change. 
   
   That being said, please add a comment here that this is meant to handle the 
field being optional for opsets 11+



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