QueensGambit commented on issue #17827: [Numpy] Bugfix of slice operator export 
(MXNet to ONNX)
URL: https://github.com/apache/incubator-mxnet/pull/17827#issuecomment-615874810
 
 
   Hello @RuRo, great to see that you have been working on the shape inference 
issue.
   Surprisingly, I didn't receive any notification for your PR and only noticed 
it after you mentioned it.
   Passing `graph_shapes` as a dict is a working solution but is cumbersome for 
deep models with changing shape sizes.
   I noticed that there is existing functionality for inferring the out-shapes 
of a symbol object.
   For instance you can plot the model structure including all shapes of each 
layer like this:
   ```python
       display(mx.viz.plot_network(
           symbol,
           shape={'data':(input_shape)},
           node_attrs={"shape":"oval","fixedsize":"false"}
       ))
   ```
   The corresponding code for inferring looks like this:
   ```python
       internals = symbol.get_internals()
       input_name = "data"
       _, out_shapes, _ = internals.infer_shape(**{input_name: input_shape})
   ```
   This way you would only require `input_name` as an additional parameter 
which could be set to `"data"` by default.
   Do you want to update your code or should I do it?

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