You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
torch.nn.Module: Compiled Module, when run it will execute via TensorRT
87
104
"""
88
-
target_ir=_module_ir(module, ir)
105
+
module_type=_parse_module_type(module)
106
+
target_ir=_get_target_ir(module_type, ir)
89
107
iftarget_ir==_IRType.ts:
90
108
ts_mod=module
91
-
ifisinstance(module, torch.nn.Module):
109
+
ifmodule_type==_ModuleType.nn:
92
110
logging.log(
93
111
logging.Level.Info,
94
112
"Module was provided as a torch.nn.Module, trying to script the module with torch.jit.script. In the event of a failure please preconvert your module to TorchScript"
enabled_precision (Set(Union(torch.dtype, torch_tensorrt.dtype))): The set of datatypes that TensorRT can use when selecting kernels
135
153
ir (str): The requested strategy to compile. (Options: default - Let Torch-TensorRT decide, ts - TorchScript with scripting path)
136
154
**kwargs: Additional settings for the specific requested strategy (See submodules for more info)
137
-
138
155
Returns:
139
156
bytes: Serialized TensorRT engine, can either be saved to a file or deserialized via TensorRT APIs
140
157
"""
141
-
target_ir=_module_ir(module, ir)
158
+
module_type=_parse_module_type(module)
159
+
target_ir=_get_target_ir(module_type, ir)
142
160
iftarget_ir==_IRType.ts:
143
161
ts_mod=module
144
-
ifisinstance(module, torch.nn.Module):
162
+
ifmodule_type==_ModuleType.nn:
145
163
logging.log(
146
164
logging.Level.Info,
147
165
"Module was provided as a torch.nn.Module, trying to script the module with torch.jit.script. In the event of a failure please preconvert your module to TorchScript"
0 commit comments