We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent af33f4a commit a658606Copy full SHA for a658606
py/torch_tensorrt/_utils.py
@@ -1,9 +1,7 @@
1
-import ctypes
2
-import platform
3
-import sys
4
from typing import Any
5
6
import torch
+from torch_tensorrt._enums import Platform
7
8
9
def sanitized_torch_version() -> Any:
@@ -14,12 +12,14 @@ def sanitized_torch_version() -> Any:
14
12
)
15
13
16
17
-def check_cross_compile_trt_win_lib():
+def check_cross_compile_trt_win_lib() -> bool:
18
# cross compile feature is only available on linux
19
# build engine on linux and run on windows
20
import dllist
21
22
- if sys.platform.startswith("linux"):
+ platform = Platform.current_platform()
+ platform = str(platform).lower()
+ if platform.startswith("linux"):
23
loaded_libs = dllist.dllist()
24
target_lib = "libnvinfer_builder_resource_win.so.*"
25
if target_lib in loaded_libs:
0 commit comments