leezu commented on a change in pull request #17970:
URL: https://github.com/apache/incubator-mxnet/pull/17970#discussion_r480243915
##########
File path: python/mxnet/gluon/block.py
##########
@@ -1343,13 +1343,18 @@ def export(self, path, epoch=0, remove_amp_cast=True):
arg_names = set(sym.list_arguments())
aux_names = set(sym.list_auxiliary_states())
arg_dict = {}
- for is_arg, name, param in self._cached_op_args:
- if not is_arg:
- if name in arg_names:
- arg_dict['arg:{}'.format(name)] = param._reduce()
- else:
+ for name, param in self.collect_params().items():
Review comment:
self.collect_params() does not contain all parameters if the block has
been optimized for a backend. You need to rely on `self._cached_op_args`
----------------------------------------------------------------
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]