RuRo commented on issue #17827: [Numpy] Bugfix of slice operator export (MXNet 
to ONNX)
URL: https://github.com/apache/incubator-mxnet/pull/17827#issuecomment-615886717
 
 
   @QueensGambit I am not quite sure, what you mean by `cumbersome for deep 
models with changing shape sizes`.
   
   The approach I use in my PR extracts the shapes in exactly the way you 
describe. The `graph_shapes` is a `dict`, mapping node names to shape tuples. 
It is [built in 
advance](https://github.com/QueensGambit/incubator-mxnet/blob/af10a38e1b5af57e1a205339dacc93b88ce61958/python/mxnet/contrib/onnx/mx2onnx/export_onnx.py#L208)
   ```python
   graph_shapes = MXNetGraph.get_outputs(sym.get_internals(), params, in_shape, 
output_label)
   ```
   by calling 
[get_outputs](https://github.com/QueensGambit/incubator-mxnet/blob/af10a38e1b5af57e1a205339dacc93b88ce61958/python/mxnet/contrib/onnx/mx2onnx/export_onnx.py#L138)
 to effectively do exactly
   ```python
   _, out_shapes, _ = internals.infer_shape(**inputs)
   ```

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