From 3ad29dafd0eeb71d0a1c2985f3c7767f69a855c8 Mon Sep 17 00:00:00 2001 From: "Zewen (Evan) Li" Date: Thu, 18 Apr 2024 15:14:37 -0700 Subject: [PATCH] move import package --- py/torch_tensorrt/_compile.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/py/torch_tensorrt/_compile.py b/py/torch_tensorrt/_compile.py index 23c1d2a153..170e97ca68 100644 --- a/py/torch_tensorrt/_compile.py +++ b/py/torch_tensorrt/_compile.py @@ -1,5 +1,6 @@ from __future__ import annotations +import collections.abc import logging from enum import Enum from typing import Any, Callable, List, Optional, Sequence, Set @@ -240,8 +241,6 @@ def compile( return compiled_fx_module elif target_ir == _IRType.dynamo: # Prepare torch and torchtrt inputs - import collections.abc - from torch_tensorrt.dynamo.utils import prepare_inputs if not isinstance(input_list, collections.abc.Sequence): @@ -345,13 +344,7 @@ def convert_method_to_trt_engine( "convert_method_to_trt_engine call is not supported for ir=fx" ) elif target_ir == _IRType.dynamo: -<<<<<<< HEAD - return dynamo_convert_module_to_trt_engine( # type: ignore[no-any-return] - module, -======= # Prepare torch and torchtrt inputs - import collections.abc - from torch_tensorrt.dynamo.utils import prepare_inputs if not isinstance(inputs, collections.abc.Sequence): @@ -361,9 +354,8 @@ def convert_method_to_trt_engine( torchtrt_inputs = prepare_inputs(inputs) exp_program = torch_tensorrt.dynamo.trace(module, torchtrt_inputs, **kwargs) - return torch_tensorrt.dynamo.convert_module_to_trt_engine( # type: ignore[no-any-return] + return dynamo_convert_module_to_trt_engine( # type: ignore[no-any-return] exp_program, ->>>>>>> 51ee9efc56e3ad13d4c76099c2e332f778d0c976 inputs=inputs, enabled_precisions=enabled_precisions_set, **kwargs,