File tree 3 files changed +5
-7
lines changed
3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -526,7 +526,6 @@ def convert_method_to_trt_engine(
526
526
raise RuntimeError ("Module is an unknown format or the ir requested is unknown" )
527
527
528
528
529
- @needs_cross_compile
530
529
def load_cross_compiled_exported_program (file_path : str = "" ) -> Any :
531
530
"""
532
531
Load an ExportedProgram file in Windows which was previously cross compiled in Linux
Original file line number Diff line number Diff line change 1
- import ctypes
2
- import platform
3
- import sys
4
1
from typing import Any
5
2
6
3
import torch
4
+ from torch_tensorrt ._enums import Platform
7
5
8
6
9
7
def sanitized_torch_version () -> Any :
@@ -14,12 +12,14 @@ def sanitized_torch_version() -> Any:
14
12
)
15
13
16
14
17
- def check_cross_compile_trt_win_lib ():
15
+ def check_cross_compile_trt_win_lib () -> bool :
18
16
# cross compile feature is only available on linux
19
17
# build engine on linux and run on windows
20
18
import dllist
21
19
22
- if sys .platform .startswith ("linux" ):
20
+ platform = Platform .current_platform ()
21
+ platform = str (platform ).lower ()
22
+ if platform .startswith ("linux" ):
23
23
loaded_libs = dllist .dllist ()
24
24
target_lib = "libnvinfer_builder_resource_win.so.*"
25
25
if target_lib in loaded_libs :
Original file line number Diff line number Diff line change @@ -1214,7 +1214,6 @@ def save_cross_compiled_exported_program(
1214
1214
logger .debug (f"successfully saved the module for windows at { file_path } " )
1215
1215
1216
1216
1217
- @needs_cross_compile
1218
1217
def load_cross_compiled_exported_program (file_path : str = "" ) -> Any :
1219
1218
"""
1220
1219
Load an ExportedProgram file in Windows which was previously cross compiled in Linux
You can’t perform that action at this time.
0 commit comments