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 2020/12/09 01:42:16 UTC

[GitHub] [tvm] lixiaoquan commented on a change in pull request #7055: Fix shape init for tvmc onnx frontend

lixiaoquan commented on a change in pull request #7055:
URL: https://github.com/apache/tvm/pull/7055#discussion_r538940103



##########
File path: python/tvm/driver/tvmc/frontends.py
##########
@@ -161,14 +161,11 @@ def load(self, path):
         # pylint: disable=E1101
         model = onnx.load(path)
 
+        shape_dict = {}
         # pylint: disable=E1101
-        name = model.graph.input[0].name
-
-        # pylint: disable=E1101
-        proto_shape = model.graph.input[0].type.tensor_type.shape.dim
-        shape = [d.dim_value for d in proto_shape]
-
-        shape_dict = {name: shape}
+        for i in model.graph.input:
+            # pylint: disable=E1101
+            shape_dict[i.name] = [dim.dim_value for dim in i.type.tensor_type.shape.dim]

Review comment:
       Should we also expose shape as an argument of TVMC,so that we can specify shape from command line?




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