MCPcopy
hub / github.com/NVIDIA/TensorRT-LLM / update_parameters

Method update_parameters

tensorrt_llm/module.py:200–209  ·  view source on GitHub ↗
(self, torch_module)

Source from the content-addressed store, hash-verified

198 yield name + ("." if name else "") + n, output
199
200 def update_parameters(self, torch_module):
201 m = {k: v for k, v in self.named_parameters()}
202 tm = {k: v for k, v in torch_module.named_parameters()}
203
204 assert sorted(m.keys()) == sorted(tm.keys()), (
205 "The parameter names of the TensorRT LLM module must be the same with the torch module"
206 )
207
208 for k, v in self.named_parameters():
209 v.value = tm[k].detach().cpu().numpy()
210
211 def _get_name(self):
212 return self.__class__.__name__

Calls 2

named_parametersMethod · 0.95
keysMethod · 0.45

Tested by

no test coverage detected