File size: 204 Bytes
453129d
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
import torch
import torch.distributed as dist


@torch.no_grad()
def solution(tensor: torch.Tensor, src: int = 0) -> torch.Tensor:
    out = tensor.clone()
    dist.broadcast(out, src=src)
    return out