Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/LeapLabTHU/DAT
/ reduce_tensor
Function
reduce_tensor
utils.py:91–95 ·
view source on GitHub ↗
(tensor)
Source
from the content-addressed store, hash-verified
89
90
91
def
reduce_tensor(tensor):
92
rt = tensor.clone()
93
dist.all_reduce(rt, op=dist.ReduceOp.SUM)
94
rt /= dist.get_world_size()
95
return
rt
96
97
def
init_dist_slurm():
98
""
"Initialize slurm distributed training environment.
Callers
2
validate
Function · 0.90
validate
Function · 0.90
Calls
no outgoing calls
Tested by
no test coverage detected