File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
py/torch_tensorrt/dynamo/backend Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,9 @@ def _compile_module(
121
121
torch_executed_ops = settings .torch_executed_ops ,
122
122
)
123
123
124
+ # Store TRT replicas of Torch subgraphs
125
+ trt_modules = {}
126
+
124
127
# Iterate over all components that can be accelerated
125
128
# Generate the corresponding TRT Module for those
126
129
for name , _ in partitioned_module .named_children ():
@@ -138,7 +141,10 @@ def _compile_module(
138
141
settings = settings ,
139
142
)
140
143
141
- # Replace FX Module with TRT Module
144
+ trt_modules [name ] = trt_mod
145
+
146
+ # Replace all FX Modules with TRT Modules
147
+ for name , trt_mod in trt_modules .items ():
142
148
setattr (partitioned_module , name , trt_mod )
143
149
144
150
return partitioned_module
You can’t perform that action at this time.
0 commit comments