MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT-LLM / register_instance

Method register_instance

tensorrt_llm/executor/rpc/rpc_server.py:195–208  ·  view source on GitHub ↗

Exposes all public methods of a class instance. Args: instance: The instance to register.

(self, instance: Any)

Source from the content-addressed store, hash-verified

193 logger_debug(f"[server] Registered function: {fname}")
194
195 def register_instance(self, instance: Any) -> None:
196 """Exposes all public methods of a class instance.
197
198 Args:
199 instance: The instance to register.
200 """
201 logger_debug(
202 f"[server] Registering instance of class: {instance.__class__.__name__}"
203 )
204 for name in dir(instance):
205 if not name.startswith('_'):
206 attr = getattr(instance, name)
207 if callable(attr):
208 self.register_function(attr, name)
209
210 def get_attr(self, name: str) -> Any:
211 """ Get the attribute of the RPC server.

Callers 1

__init__Method · 0.95

Calls 2

register_functionMethod · 0.95
logger_debugFunction · 0.85

Tested by

no test coverage detected