Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/OpenDriveLab/ReSim
/ normalize_tensor
Function
normalize_tensor
sat/sgm/modules/autoencoding/lpips/loss/lpips.py:126–128 ·
view source on GitHub ↗
(x, eps=1e-10)
Source
from the content-addressed store, hash-verified
124
125
126
def
normalize_tensor(x, eps=1e-10):
127
norm_factor = torch.sqrt(torch.sum(x**2, dim=1, keepdim=True))
128
return
x / (norm_factor + eps)
129
130
131
def
spatial_average(x, keepdim=True):
Callers
1
forward
Method · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected