MCPcopy Index your code
hub / github.com/deepspeedai/DeepSpeedExamples / __init__

Method __init__

Megatron-LM/fp16/fp16.py:60–62  ·  view source on GitHub ↗
(self, module)

Source from the content-addressed store, hash-verified

58
59class FP16_Module(nn.Module):
60 def __init__(self, module):
61 super(FP16_Module, self).__init__()
62 self.add_module('module', module.half())
63
64 def forward(self, *inputs, **kwargs):
65 return fp16_to_fp32(self.module(*(fp32_to_fp16(inputs)), **kwargs))

Callers

nothing calls this directly

Calls 1

halfMethod · 0.80

Tested by

no test coverage detected