Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/NVIDIA/TensorRT
/ reduce_tensor
Function
reduce_tensor
demo/Tacotron2/train.py:152–156 ·
view source on GitHub ↗
(tensor, num_gpus)
Source
from the content-addressed store, hash-verified
150
151
152
def
reduce_tensor(tensor, num_gpus):
153
rt = tensor.clone()
154
dist.all_reduce(rt, op=dist.reduce_op.SUM)
155
rt /= num_gpus
156
return
rt
157
158
159
def
init_distributed(args, world_size, rank, group_name):
Callers
2
validate
Function · 0.85
main
Function · 0.85
Calls
1
clone
Method · 0.45
Tested by
no test coverage detected