Skip to content

Commit de5b8d7

Browse files
authored
Import dllist only on linux (#3592)
1 parent b206884 commit de5b8d7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

py/torch_tensorrt/_utils.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
from typing import Any
21
import sys
3-
import platform
2+
from typing import Any
43

54
import torch
65

@@ -16,9 +15,9 @@ def sanitized_torch_version() -> Any:
1615
def check_cross_compile_trt_win_lib() -> bool:
1716
# cross compile feature is only available on linux
1817
# build engine on linux and run on windows
19-
import dllist
20-
2118
if sys.platform.startswith("linux"):
19+
import dllist
20+
2221
loaded_libs = dllist.dllist()
2322
target_lib = "libnvinfer_builder_resource_win.so.*"
2423
if target_lib in loaded_libs:

0 commit comments

Comments
 (0)