mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-13 21:22:49 +00:00
fix format (#332)
Co-authored-by: 何晓昕 <cautious@r-205-106-25-172.comp.nus.edu.sg>
This commit is contained in:
@@ -104,6 +104,6 @@ def gather_split_1d_tensor(tensor):
|
||||
gathered = torch.empty(numel_gathered, dtype=tensor.dtype,
|
||||
device=torch.cuda.current_device(),
|
||||
requires_grad=False)
|
||||
chunks = [gathered[i*numel:(i+1)*numel] for i in range(world_size)]
|
||||
chunks = [gathered[i * numel:(i + 1) * numel] for i in range(world_size)]
|
||||
dist.all_gather(chunks, tensor, group=gpc.get_group(ParallelMode.PARALLEL_1D))
|
||||
return gathered
|
||||
|
Reference in New Issue
Block a user