Skip to content

Commit 89b6216

Browse files
committed
Added backward compatibility
1 parent a72778e commit 89b6216

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,
@@ -182,7 +183,16 @@ def compile(
182183
f"Detected torch_executed_modules was non-empty: {torch_executed_modules}"
183184
"\nThis feature is unimplemented in Torch-TRT Dynamo currently."
184185
)
185-
186+
if inputs:
187+
logger.warning(
188+
"'inputs' is deprecated. Please use 'args_inputs' in the future."
189+
)
190+
if not arg_inputs:
191+
arg_inputs = inputs
192+
else:
193+
logger.warning(
194+
"Both 'arg_inputs' and 'inputs' are received. 'inputs' will be ignored."
195+
)
186196
if not isinstance(arg_inputs, collections.abc.Sequence):
187197
arg_inputs = [arg_inputs]
188198

0 commit comments

Comments
 (0)