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 2021/01/16 01:35:56 UTC
[GitHub] [incubator-mxnet] josephevans commented on a change in pull request #19755: [v1.x] ONNX contrib_box_nms
josephevans commented on a change in pull request #19755:
URL: https://github.com/apache/incubator-mxnet/pull/19755#discussion_r558743783
##########
File path: python/mxnet/contrib/onnx/mx2onnx/export_onnx.py
##########
@@ -140,8 +141,10 @@ def get_outputs(sym, params, in_shape, in_label, in_type):
out_names = list()
for name in sym.list_outputs():
- if name.endswith('_output'):
+ if re.search('.*_output$', name):
Review comment:
Why use a regex here? endswith would be more efficient.
##########
File path: python/mxnet/contrib/onnx/mx2onnx/export_onnx.py
##########
@@ -140,8 +141,10 @@ def get_outputs(sym, params, in_shape, in_label, in_type):
out_names = list()
for name in sym.list_outputs():
- if name.endswith('_output'):
+ if re.search('.*_output$', name):
out_names.append(name[:-len('_output')])
+ elif re.search('.*_output[0-9]$', name):
Review comment:
Instead of using a regex here, you could just check for output in the string, like:
if name[-len('output0'):-1] == 'output':
----------------------------------------------------------------
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