Skip to content

Commit

Permalink
Merge pull request PaddlePaddle#1745 from reyoung/feature/fix_sparse_…
Browse files Browse the repository at this point in the history
…local_update

Disable sparse_remote_update when local in paddle.v2
  • Loading branch information
reyoung authored Apr 5, 2017
2 parents 93007fe + 718d61c commit cd81075
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/paddle/v2/trainer.py
Original file line number Diff line number Diff line change
@@ -52,6 +52,12 @@ def __init__(self, cost, parameters, update_equation):
self.__topology__ = topology
self.__parameters__ = parameters
self.__topology_in_proto__ = topology.proto()

# In local mode, disable sparse_remote_update.
for param in self.__topology_in_proto__.parameters:
if param.sparse_remote_update:
param.sparse_remote_update = False

self.__data_types__ = topology.data_type()
gm = api.GradientMachine.createFromConfigProto(
self.__topology_in_proto__, api.CREATE_MODE_NORMAL,

0 comments on commit cd81075

Please sign in to comment.