piiswrong closed pull request #10515: Prevent partially update of ParameterDict
URL: https://github.com/apache/incubator-mxnet/pull/10515
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/python/mxnet/gluon/parameter.py b/python/mxnet/gluon/parameter.py
index ab511ab6e42..8d0c5ba7af4 100644
--- a/python/mxnet/gluon/parameter.py
+++ b/python/mxnet/gluon/parameter.py
@@ -661,8 +661,9 @@ def update(self, other):
                 assert self._params[k] is v, \
                     "Cannot update self with other because they have different 
" \
                     "Parameters with the same name '%s'"%k
-            else:
-                self._params[k] = v
+
+        for k, v in other.items():
+            self._params[k] = v
 
     def initialize(self, init=initializer.Uniform(), ctx=None, verbose=False,
                    force_reinit=False):


 

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