Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/AIS-SNU/Smart-Infinity
/ to_python_float
Function
to_python_float
DeepSpeedExample/megatron/fp16/loss_scaler.py:26–30 ·
view source on GitHub ↗
(t)
Source
from the content-addressed store, hash-verified
24
25
26
def
to_python_float(t):
27
if
hasattr(t,
'item'
):
28
return
t.item()
29
else
:
30
return
t[0]
31
32
33
class
LossScaler:
Callers
nothing calls this directly
Calls
no outgoing calls
Tested by
no test coverage detected