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

Method to_dict

tensorrt_llm/builder.py:70–90  ·  view source on GitHub ↗

return a dict with keys { "builder_config": { # all key values set by the _init function }, "plugin_config": { # the network plugin_config (if any) attached to this BuilderConfig object # inside the Builder.b

(self)

Source from the content-addressed store, hash-verified

68 return self._trt_builder_config
69
70 def to_dict(self) -> Dict:
71 '''return a dict with keys
72 {
73 "builder_config": {
74 # all key values set by the _init function
75 },
76 "plugin_config": {
77 # the network plugin_config (if any) attached to this BuilderConfig object
78 # inside the Builder.build_engine
79 }
80 }
81 '''
82 config = {'builder_config': {}}
83 for k in self.__dict__.keys():
84 if k not in ['_trt_builder_config', 'plugin_config']:
85 config['builder_config'][k] = self.__getattribute__(k)
86 if hasattr(self, 'plugin_config'):
87 assert isinstance(self.plugin_config, PluginConfig), \
88 f"Found unexpected plugin_config object with type: {type(self.plugin_config)}"
89 config['plugin_config'] = self.plugin_config.model_dump(mode="json")
90 return config
91
92
93class Builder():

Callers

nothing calls this directly

Calls 2

keysMethod · 0.45
__getattribute__Method · 0.45

Tested by

no test coverage detected