From 8cac7c25ee5bc199d6e4059297ef2fa92d9c069c Mon Sep 17 00:00:00 2001 From: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com> Date: Sun, 26 Sep 2021 21:14:49 +0800 Subject: [PATCH] [Refactor] Remove outdated code (#1370) --- mmcv/runner/dist_utils.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/mmcv/runner/dist_utils.py b/mmcv/runner/dist_utils.py index d1250aa7f1..d3a1ef3fda 100644 --- a/mmcv/runner/dist_utils.py +++ b/mmcv/runner/dist_utils.py @@ -10,8 +10,6 @@ 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: