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

Function make_invocable

tools/Polygraphy/polygraphy/tools/script.py:125–148  ·  view source on GitHub ↗

Creates a string representation that will invoke the specified object, with the specified arguments. Args: type_str (str): A string representing the object that should be invoked. args, kwargs: Arguments to pass along to the object. If a keyword argument

(type_str, *args, **kwargs)

Source from the content-addressed store, hash-verified

123
124@mod.export()
125def make_invocable(type_str, *args, **kwargs):
126 """
127 Creates a string representation that will invoke the specified object,
128 with the specified arguments.
129
130 Args:
131 type_str (str): A string representing the object that should be invoked.
132 args, kwargs:
133 Arguments to pass along to the object. If a keyword argument
134 is set to None, it will be omitted.
135
136 Returns:
137 str: A string representation that invokes the object specified.
138
139 For example:
140 ::
141
142 >>> make_invocable("MyClass", 0, 1, last=3)
143 "MyClass(0, 1, last=3)"
144
145 >>> make_invocable("my_func", 0, 1, last=None)
146 "my_func(0, 1)"
147 """
148 return make_invocable_impl(type_str, *args, **kwargs)[0]
149
150
151@mod.export()

Callers 15

add_to_script_implMethod · 0.90
add_to_script_implMethod · 0.90
run_implMethod · 0.90
add_to_script_implMethod · 0.90
add_to_script_implMethod · 0.90
add_to_script_implMethod · 0.90
add_to_script_implMethod · 0.90
add_to_script_implMethod · 0.90
add_to_script_implMethod · 0.90
add_to_script_implMethod · 0.90
add_to_script_implMethod · 0.90
add_to_script_implMethod · 0.90

Calls 1

make_invocable_implFunction · 0.85

Tested by 2

test_invoke_none_argsMethod · 0.72