MCPcopy Index your code
hub / github.com/NVIDIA/TensorRT-LLM / named_modules

Method named_modules

tensorrt_llm/module.py:102–114  ·  view source on GitHub ↗
(self, memo=None, prefix="", remove_duplicate=True)

Source from the content-addressed store, hash-verified

100 super().__setattr__(name, value)
101
102 def named_modules(self, memo=None, prefix="", remove_duplicate=True):
103 if memo is None:
104 memo = set()
105 if self not in memo:
106 if remove_duplicate:
107 memo.add(self)
108 yield prefix, self
109 for name, module in self._modules.items():
110 if module is None:
111 continue
112 submodule_prefix = prefix + ("." if prefix else "") + name
113 for m in module.named_modules(memo, submodule_prefix, remove_duplicate):
114 yield m
115
116 def named_modules_with_parent(self, memo=None, prefix="", parent=None, remove_duplicate=True):
117 if memo is None:

Callers 15

_named_membersMethod · 0.95
named_network_outputsMethod · 0.95
_load_layer_from_modelFunction · 0.80
_load_nemotron_moe_layerFunction · 0.80
_set_gate_weightsFunction · 0.80
int4awq_state_dict_hookFunction · 0.80
test_moduleMethod · 0.80
test_module_listMethod · 0.80
load_weightsMethod · 0.80
capture_activation_rangeFunction · 0.80

Calls 1

addMethod · 0.45

Tested by 7

_load_layer_from_modelFunction · 0.64
_load_nemotron_moe_layerFunction · 0.64
_set_gate_weightsFunction · 0.64
int4awq_state_dict_hookFunction · 0.64
test_moduleMethod · 0.64
test_module_listMethod · 0.64