Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/OpenDriveLab/DriveAdapter
/ sum_independent_dims
Function
sum_independent_dims
roach/models/distributions.py:9–14 ·
view source on GitHub ↗
(tensor: th.Tensor)
Source
from the content-addressed store, hash-verified
7
8
9
def
sum_independent_dims(tensor: th.Tensor) -> th.Tensor:
10
if
len(tensor.shape) > 1:
11
tensor = tensor.sum(dim=1)
12
else
:
13
tensor = tensor.sum()
14
return
tensor
15
16
17
class
DiagGaussianDistribution():
Callers
3
log_prob
Method · 0.85
log_prob
Method · 0.85
log_prob
Method · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected