MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / find_method

Function find_method

tools/Polygraphy/polygraphy/mod/exporter.py:102–108  ·  view source on GitHub ↗
(symbol, method)

Source from the content-addressed store, hash-verified

100
101 # Find a method by wallking the inheritance hierarchy of a type:
102 def find_method(symbol, method):
103 hierarchy = inspect.getmro(symbol)
104 for ancestor in hierarchy:
105 if method in vars(ancestor):
106 return vars(ancestor)[method]
107
108 assert False, f"Could not find method: {method} in the inheritance hierarcy of: {symbol}"
109
110 def export_impl(func_or_cls):
111 _add_to_all(func_or_cls.__name__, module)

Callers 2

get_paramsFunction · 0.85
try_add_method_docFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected