Skip to content

Commit 232cdc9

Browse files
authored
fix: typing issue in Python 3.9 and earlier (#3431)
1 parent 187d676 commit 232cdc9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

py/torch_tensorrt/dynamo/conversion/_ConverterRegistry.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ def __contains__(self, key: Target | Node) -> bool:
519519
def get_all_converters_with_target(
520520
self, key: Target, return_registry_info: bool = False
521521
) -> Tuple[
522-
List[Any], Dict[str, int] | None
522+
Union[List[Any], Dict[str, int], None]
523523
]: # TODO: Narrow to ConverterImplSignature this when we can remove FX converters
524524
"""Get all converters across all registries for the target
525525

py/torch_tensorrt/dynamo/runtime/_MutableTorchTensorRTModule.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def forward(a, b, c=0, d=0):
252252

253253
self.refit_state.set_state(RefitFlag.NEEDS_RECOMPILE)
254254

255-
def _get_total_dynamic_shapes(self) -> dict[str, Any] | None:
255+
def _get_total_dynamic_shapes(self) -> Union[dict[str, Any], None]:
256256
if not self.arg_dynamic_shapes and not self.kwarg_dynamic_shapes:
257257
return None
258258
total_dynamic_shape = {}

0 commit comments

Comments
 (0)