This is an automated email from the ASF dual-hosted git repository.

jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new 4852a99  Prevent partially update of ParameterDict (#10515)
4852a99 is described below

commit 4852a99d096682b83d8e2093240e8a9022f4699e
Author: Kenta Murata <m...@users.noreply.github.com>
AuthorDate: Fri Apr 13 05:01:37 2018 +0900

    Prevent partially update of ParameterDict (#10515)
    
    * Prevent partially update of ParameterDict if keys are conflicted
    
    * Update parameter.py
---
 python/mxnet/gluon/parameter.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/python/mxnet/gluon/parameter.py b/python/mxnet/gluon/parameter.py
index ab511ab..8d0c5ba 100644
--- a/python/mxnet/gluon/parameter.py
+++ b/python/mxnet/gluon/parameter.py
@@ -661,8 +661,9 @@ class ParameterDict(object):
                 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):

-- 
To stop receiving notification emails like this one, please contact
j...@apache.org.

Reply via email to