Unverified Commit f429381e authored by rxy1212's avatar rxy1212 Committed by GitHub
Browse files

Merge pull request #1 from rxy1212/rxy1212-fix

Update __init__.py
parents a99e1875 870c917a
...@@ -4,13 +4,17 @@ import torch ...@@ -4,13 +4,17 @@ import torch
# https://github.com/pytorch/pytorch/pull/14767 # https://github.com/pytorch/pytorch/pull/14767
if hasattr(torch.distributed, 'get_default_group'): if hasattr(torch.distributed, 'get_default_group'):
group_creator = torch.distributed.get_default_group group_creator = torch.distributed.get_default_group
else: elif hasattr(torch.distributed, 'new_group'):
group_creator = torch.distributed.new_group group_creator = torch.distributed.new_group
else:
group_creator = torch.distributed.deprecated.new_group
if hasattr(torch.distributed, 'ReduceOp'): if hasattr(torch.distributed, 'ReduceOp'):
ReduceOp = torch.distributed.ReduceOp ReduceOp = torch.distributed.ReduceOp
else: elif hasattr(torch.distributed, 'reduce_op'):
ReduceOp = torch.distributed.reduce_op ReduceOp = torch.distributed.reduce_op
else:
ReduceOp = torch.distributed.deprecated.reduce_op
from .distributed import DistributedDataParallel, Reducer from .distributed import DistributedDataParallel, Reducer
try: try:
......
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