MCPcopy
hub / github.com/NVIDIA/TensorRT-LLM / net_guard

Function net_guard

tensorrt_llm/network.py:900–909  ·  view source on GitHub ↗
(network)

Source from the content-addressed store, hash-verified

898
899@contextlib.contextmanager
900def net_guard(network):
901 from ._common import net
902 assert isinstance(
903 network, Network
904 ), f"Invalid network, can only guard Network instance, got: {network}"
905
906 old_net = net
907 set_network(network)
908 yield
909 set_network(old_net)
910
911
912class _TrtLlmModuleCallStack(object):

Callers 15

build_bertFunction · 0.90
initialize_networkMethod · 0.90
rewriteMethod · 0.90
match_and_rewriteMethod · 0.90
build_engineFunction · 0.90

Calls 1

set_networkFunction · 0.85