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

Method _cast_inputs_half

deepspeed/runtime/engine.py:1763–1777  ·  view source on GitHub ↗
(self, inputs)

Source from the content-addressed store, hash-verified

1761 return loss
1762
1763 def _cast_inputs_half(self, inputs):
1764 if isinstance(inputs, (list, tuple)):
1765 new_inputs = []
1766 for v in inputs:
1767 new_inputs.append(self._cast_inputs_half(v))
1768 return inputs.__class__(new_inputs)
1769 elif isinstance(inputs, dict):
1770 new_inputs = {}
1771 for k, v in inputs.items():
1772 new_inputs[k] = self._cast_inputs_half(v)
1773 return new_inputs
1774 elif hasattr(inputs, 'half'):
1775 return inputs.half()
1776 else:
1777 return inputs
1778
1779 def print_forward_breakdown(self, fwd_time):
1780 gate_time = 0.0

Callers 1

forwardMethod · 0.95

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected