You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/05/16 00:16:32 UTC

[GitHub] anirudh2290 commented on a change in pull request #10512: [MXNET-309] [ONNX-MXNet] Model Metadata API

anirudh2290 commented on a change in pull request #10512: [MXNET-309] [ONNX-MXNet] Model Metadata API
URL: https://github.com/apache/incubator-mxnet/pull/10512#discussion_r188472506
 
 

 ##########
 File path: python/mxnet/contrib/onnx/_import/import_onnx.py
 ##########
 @@ -132,6 +132,33 @@ def from_onnx(self, graph):
             out = out[0]
         return out, argDict, auxDict
 
+    def get_graph_metadata(self, graph):
+        """
+        Get the model metadata from a given onnx graph.
+        """
+        _params = set()
+        for tensor_vals in graph.initializer:
+            _params.add(tensor_vals.name)
+
+        input_data = []
+        for graph_input in graph.input:
+            shape = []
+            if graph_input.name not in _params:
+                for val in graph_input.type.tensor_type.shape.dim:
+                    shape.append(val.dim_value)
+                input_data.append((graph_input.name, tuple(shape)))
+
+        output_data = []
+        for graph_out in graph.output:
+            shape = []
 
 Review comment:
   same as above

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services