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

Function float_conversion

DeepSpeedExample/megatron/fp16/fp16.py:58–64  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

56def fp16_to_fp32(val):
57 """Convert fp16 `val` to fp32"""
58 def float_conversion(val):
59 val_typecheck = val
60 if isinstance(val_typecheck, (Parameter, Variable)):
61 val_typecheck = val.data
62 if isinstance(val_typecheck, HALF_TYPES):
63 val = val.float()
64 return val
65 return conversion_helper(val, float_conversion)
66
67

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected