Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Fix the list to singlton conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
apeforest committed Mar 9, 2020
1 parent 34f92a4 commit fc382d9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions python/mxnet/kvstore/horovod.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,20 @@ def pushpull(self, key, value, out=None, priority=0):
import horovod.mxnet as hvd

if out is None:
hvd.allreduce_(value, average=False, name=key, priority=priority)
value = value if isinstance(value, list) else [value]
for v in value:
hvd.allreduce_(v, average=False, name=str(key), priority=priority)
else:
out[:] = hvd.allreduce(value, average=False, name=key, priority=priority)
out = out if isinstance(out, list) else [out]
for o in out:
o[:] = hvd.allreduce(value, average=False, name=str(key), priority=priority)

def set_optimizer(self, optimizer):
pass

@staticmethod
def is_capable(capability):
pass
return False

def save_optimizer_states(self, fname, dump_optimizer=False):
pass
Expand Down

0 comments on commit fc382d9

Please sign in to comment.