Skip to content

Commit f26078f

Browse files
authored
Fixed all gather on number with ws=1 (#3087)
1 parent 64bd77e commit f26078f

File tree

1 file changed

+1
-4
lines changed
  • ignite/distributed/comp_models

1 file changed

+1
-4
lines changed

ignite/distributed/comp_models/base.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,7 @@ def _collective_op(
199199
tensor = self._apply_op(tensor, device, fn, *args, **kwargs)
200200

201201
if tensor_to_number:
202-
if tensor.numel() == 1:
203-
return tensor.item()
204-
else:
205-
return tensor.tolist()
202+
return tensor.tolist()
206203
elif tensor_to_str:
207204
return self._decode_str(tensor)
208205
return tensor

0 commit comments

Comments
 (0)