MCPcopy Create free account
hub / github.com/NVIDIA/FasterTransformer / set_weight

Method set_weight

examples/pytorch/gpt/utils/gpt_decoder.py:345–349  ·  view source on GitHub ↗
(self, weight: GptLayerWeights)

Source from the content-addressed store, hash-verified

343 raise NotImplementedError
344
345 def set_weight(self, weight: GptLayerWeights):
346 old_weight_dtype = self.weight.dtype if self.weight is not None else None
347 self.weight = weight
348 if old_weight_dtype is None or old_weight_dtype != self.weight.dtype:
349 self._initialize_model(force_init=True)
350
351 @property
352 def dtype(self):

Callers 1

loadMethod · 0.80

Calls 1

_initialize_modelMethod · 0.95

Tested by

no test coverage detected