Explorar o código

check for None

justheuristic %!s(int64=3) %!d(string=hai) anos
pai
achega
1d408e8e9c
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      hivemind/averaging/averager.py

+ 3 - 2
hivemind/averaging/averager.py

@@ -455,9 +455,10 @@ class DecentralizedAverager(mp.Process, ServicerBase):
 
                     group_info = await matchmaking_task
 
+                    if group_info is None:
+                        raise AllreduceException("Averaging step failed: could not find a group")
+
                     with self._register_allreduce_group(group_info):
-                        if group_info is None:
-                            raise AllreduceException("Averaging step failed: could not find a group")
 
                         step.stage = AveragingStage.RUNNING_ALLREDUCE