MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / to_python_float

Function to_python_float

deepspeed/runtime/fp16/loss_scaler.py:36–39  ·  view source on GitHub ↗
(t)

Source from the content-addressed store, hash-verified

34
35# item() is a recent addition, so this helps with backward compatibility.
36def to_python_float(t):
37 if hasattr(t, 'item'):
38 return t.item()
39 return t[0]
40
41
42class LossScalerBase:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected