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 2018/05/15 01:16:48 UTC

[GitHub] eric-haibin-lin commented on a change in pull request #10924: [Sparse-Gluon] [WIP] embedding with sparse grad

eric-haibin-lin commented on a change in pull request #10924: [Sparse-Gluon] [WIP] embedding with sparse grad
URL: https://github.com/apache/incubator-mxnet/pull/10924#discussion_r188142020
 
 

 ##########
 File path: python/mxnet/gluon/trainer.py
 ##########
 @@ -110,16 +110,29 @@ def _init_optimizer(self, optimizer, optimizer_params):
                             for _ in self._contexts]
 
     def _init_kvstore(self):
-        arg_arrays = {param.name: param.data(self._contexts[0]) for param in self._params}
+        arg_arrays = {}
+        contains_sparse = False
+        for param in self._params:
+            arg_arrays[param.name] = param.data(self._contexts[0])
+            if param._grad_stype != 'default':
+                contains_sparse = True
+                # update_on_kvstore is set to False by the user
+                if self._update_on_kvstore is False:
 
 Review comment:
   if self._update_on_kvstore is None, I don't need to throw the err

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


With regards,
Apache Git Services