Skip to content

Commit 0e4be6b

Browse files
committed
Added backward compatibility
1 parent 346d45f commit 0e4be6b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

py/torch_tensorrt/dynamo/_compiler.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def compile(
4949
exported_program: ExportedProgram,
5050
arg_inputs: Tuple[Any, ...],
5151
*,
52+
inputs: Optional[Tuple[Any, ...]] = None,
5253
kwarg_inputs: Optional[dict[Any, Any]] = None,
5354
device: Optional[Union[Device, torch.device, str]] = _defaults.DEVICE,
5455
disable_tf32: bool = _defaults.DISABLE_TF32,
@@ -168,7 +169,16 @@ def compile(
168169
f"Detected torch_executed_modules was non-empty: {torch_executed_modules}"
169170
"\nThis feature is unimplemented in Torch-TRT Dynamo currently."
170171
)
171-
172+
if inputs:
173+
logger.warning(
174+
"'inputs' is deprecated. Please use 'args_inputs' in the future."
175+
)
176+
if not arg_inputs:
177+
arg_inputs = inputs
178+
else:
179+
logger.warning(
180+
"Both 'arg_inputs' and 'inputs' are received. 'inputs' will be ignored."
181+
)
172182
if not isinstance(arg_inputs, collections.abc.Sequence):
173183
arg_inputs = [arg_inputs]
174184

0 commit comments

Comments
 (0)