(tensor, n)
| 9 | |
| 10 | |
| 11 | def reduce_tensor(tensor, n): |
| 12 | rt = tensor.clone() |
| 13 | dist.all_reduce(rt, op=dist.ReduceOp.SUM) |
| 14 | rt /= n |
| 15 | return rt |
| 16 | |
| 17 | |
| 18 | def distribute_bn(model, world_size, reduce=False): |
nothing calls this directly
no outgoing calls
no test coverage detected