Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/MegEngine/MegEngine
/ norm
Function
norm
imperative/python/test/unit/optimizer/test_lamb.py:32–33 ·
view source on GitHub ↗
(vec)
Source
from the content-addressed store, hash-verified
30
c1, c05, c0 = map(tensor, (1.0, 0.5, 0.0))
31
32
def
norm(vec):
33
return
sum(vec * vec) ** c05
34
35
p_norm = norm(param.flatten())
36
Callers
3
lamb_update
Function · 0.70
__init__
Method · 0.50
__init__
Method · 0.50
Calls
1
sum
Function · 0.85
Tested by
no test coverage detected