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

Function inline

tools/Polygraphy/polygraphy/tools/script.py:78–96  ·  view source on GitHub ↗

Marks a safe string as being inline when used with other Script APIs. Non-inlined strings will remain strings when used with any of these APIs. For example: :: >>> make_invocable("print", safe("example")) "print('example')" >>> make_invocable("print", inlin

(inp)

Source from the content-addressed store, hash-verified

76
77@mod.export()
78def inline(inp):
79 """
80 Marks a safe string as being inline when used with other Script APIs.
81 Non-inlined strings will remain strings when used with any of these APIs.
82 For example:
83 ::
84
85 >>> make_invocable("print", safe("example"))
86 "print('example')"
87
88 >>> make_invocable("print", inline(safe("example")))
89 "print(example)"
90
91 Args:
92 inp (Script.String): The safe string to inline.
93 """
94 inp = ensure_safe(inp)
95 inp.inline = True
96 return inp
97
98
99def make_invocable_impl(type_str, *args, **kwargs):

Callers 15

run_implMethod · 0.90
run_implMethod · 0.90
parse_implMethod · 0.90
parse_implMethod · 0.90
add_to_script_implMethod · 0.90
parse_implMethod · 0.90
add_to_script_implMethod · 0.90
parse_implMethod · 0.90
make_trt_enum_valFunction · 0.90
add_to_script_implMethod · 0.90
add_to_script_implMethod · 0.90
add_to_script_implMethod · 0.90

Calls 1

ensure_safeFunction · 0.85

Tested by 1

script_addMethod · 0.72