reminisce commented on a change in pull request #10425: [MXNET-175] 
NdArrayiterator dict fix
URL: https://github.com/apache/incubator-mxnet/pull/10425#discussion_r180856241
 
 

 ##########
 File path: python/mxnet/module/base_module.py
 ##########
 @@ -268,6 +285,10 @@ def score(self, eval_data, eval_metric, num_batch=None, 
batch_end_callback=None,
             for callback in _as_list(score_end_callback):
                 callback(params)
 
+        # restoring original user data if changed:
+        if orig_eval_data is not None:
 
 Review comment:
   This seems dangerous. If some exception is thrown before this line, the 
`eval_data.data` will not be restored. I think it would be better if you can 
modify `eval_batch.data` inside the `for` loop.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to