File tree 1 file changed +2
-6
lines changed
py/torch_tensorrt/dynamo/conversion/impl
1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change 1
1
from typing import Optional , Sequence , Union
2
2
3
- import numpy as np
4
- import torch
5
3
from torch .fx .node import Target
6
4
from torch_tensorrt .dynamo .conversion ._ConversionContext import ConversionContext
7
- from torch_tensorrt .dynamo .conversion .converter_utils import SourceIR , get_trt_tensor
5
+ from torch_tensorrt .dynamo .conversion .converter_utils import SourceIR
8
6
from torch_tensorrt .fx .converters .converter_utils import set_layer_name
9
7
from torch_tensorrt .fx .types import TRTTensor
10
8
@@ -14,11 +12,9 @@ def reshape(
14
12
target : Union [Target , str ],
15
13
source_ir : Optional [SourceIR ],
16
14
name : str ,
17
- input : Sequence [ Union [ TRTTensor , torch . Tensor , np . ndarray ]] ,
15
+ input : TRTTensor ,
18
16
shape : Sequence [int ],
19
17
) -> TRTTensor :
20
- if not isinstance (input , TRTTensor ):
21
- input = get_trt_tensor (ctx , input , f"{ name } _input" )
22
18
layer = ctx .net .add_shuffle (input )
23
19
layer .reshape_dims = tuple (shape )
24
20
set_layer_name (layer , target , name , source_ir )
You can’t perform that action at this time.
0 commit comments