mirror of
https://github.com/open-mmlab/mmcv.git
synced 2025-06-03 21:54:52 +08:00
[Refactor] Remove outdated code (#1370)
This commit is contained in:
parent
a90b3978db
commit
8cac7c25ee
@ -10,8 +10,6 @@ from torch import distributed as dist
|
||||
from torch._utils import (_flatten_dense_tensors, _take_tensors,
|
||||
_unflatten_dense_tensors)
|
||||
|
||||
from mmcv.utils import TORCH_VERSION, digit_version
|
||||
|
||||
|
||||
def init_dist(launcher, backend='nccl', **kwargs):
|
||||
if mp.get_start_method(allow_none=True) is None:
|
||||
@ -78,15 +76,7 @@ def _init_dist_slurm(backend, port=None):
|
||||
|
||||
|
||||
def get_dist_info():
|
||||
if (TORCH_VERSION != 'parrots'
|
||||
and digit_version(TORCH_VERSION) < digit_version('1.0')):
|
||||
initialized = dist._initialized
|
||||
else:
|
||||
if dist.is_available():
|
||||
initialized = dist.is_initialized()
|
||||
else:
|
||||
initialized = False
|
||||
if initialized:
|
||||
if dist.is_available() and dist.is_initialized():
|
||||
rank = dist.get_rank()
|
||||
world_size = dist.get_world_size()
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user