Commit 00ac823e authored by freewym's avatar freewym Committed by Facebook Github Bot
Browse files

Replace the use of the deprecated torch.distributed.reduce_op with to… (#804)

Summary:
…rch.distributed.ReduceOp
Pull Request resolved: https://github.com/pytorch/fairseq/pull/804

Differential Revision: D15877033

Pulled By: myleott

fbshipit-source-id: 58e7c39a88b67345a55b761fee4d9f211a5ee82c
parent 14282ff3
......@@ -62,7 +62,7 @@ class FairseqBMUF(FairseqOptimizer):
if self.get_num_updates() % self.sync_iter == 0:
size = float(dist.get_world_size())
for p in self.params:
dist.all_reduce(p.data, op=dist.reduce_op.SUM)
dist.all_reduce(p.data, op=dist.ReduceOp.SUM)
p.data /= size
def step(self, closure=None):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment