Skip to content

Commit 6c9fb39

Browse files
committed
Remove upsample_*.vec
1 parent 13323b2 commit 6c9fb39

File tree

2 files changed

+14
-244
lines changed

2 files changed

+14
-244
lines changed

py/torch_tensorrt/dynamo/conversion/aten_ops_converters.py

Lines changed: 7 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -3019,7 +3019,7 @@ def aten_ops_pad(
30193019
0: (TRTTensor,),
30203020
}
30213021
)
3022-
def aten_ops_upsample_nearest1d_default(
3022+
def aten_ops_upsample_nearest1d(
30233023
ctx: ConversionContext,
30243024
target: Target,
30253025
args: Tuple[Argument, ...],
@@ -3045,7 +3045,7 @@ def aten_ops_upsample_nearest1d_default(
30453045
0: (TRTTensor,),
30463046
}
30473047
)
3048-
def aten_ops_upsample_nearest2d_default(
3048+
def aten_ops_upsample_nearest2d(
30493049
ctx: ConversionContext,
30503050
target: Target,
30513051
args: Tuple[Argument, ...],
@@ -3071,7 +3071,7 @@ def aten_ops_upsample_nearest2d_default(
30713071
0: (TRTTensor,),
30723072
}
30733073
)
3074-
def aten_ops_upsample_nearest3d_default(
3074+
def aten_ops_upsample_nearest3d(
30753075
ctx: ConversionContext,
30763076
target: Target,
30773077
args: Tuple[Argument, ...],
@@ -3091,41 +3091,13 @@ def aten_ops_upsample_nearest3d_default(
30913091
)
30923092

30933093

3094-
@dynamo_tensorrt_converter(torch.ops.aten.upsample_nearest1d.vec)
3095-
@dynamo_tensorrt_converter(torch.ops.aten.upsample_nearest2d.vec)
3096-
@dynamo_tensorrt_converter(torch.ops.aten.upsample_nearest3d.vec)
3097-
@enforce_tensor_types(
3098-
{
3099-
0: (TRTTensor,),
3100-
}
3101-
)
3102-
def aten_ops_upsample_nearest_vec(
3103-
ctx: ConversionContext,
3104-
target: Target,
3105-
args: Tuple[Argument, ...],
3106-
kwargs: Dict[str, Argument],
3107-
name: str,
3108-
) -> Union[TRTTensor, Sequence[TRTTensor]]:
3109-
return impl.upsample.upsample(
3110-
ctx,
3111-
target,
3112-
SourceIR.ATEN,
3113-
name,
3114-
args[0],
3115-
size=args_bounds_check(args, 1),
3116-
scale_factor=args_bounds_check(args, 2),
3117-
mode="nearest",
3118-
align_corners=False,
3119-
)
3120-
3121-
31223094
@dynamo_tensorrt_converter(torch.ops.aten.upsample_linear1d.default)
31233095
@enforce_tensor_types(
31243096
{
31253097
0: (TRTTensor,),
31263098
}
31273099
)
3128-
def aten_ops_upsample_linear1d_default(
3100+
def aten_ops_upsample_linear1d(
31293101
ctx: ConversionContext,
31303102
target: Target,
31313103
args: Tuple[Argument, ...],
@@ -3151,7 +3123,7 @@ def aten_ops_upsample_linear1d_default(
31513123
0: (TRTTensor,),
31523124
}
31533125
)
3154-
def aten_ops_upsample_bilinear2d_default(
3126+
def aten_ops_upsample_bilinear2d(
31553127
ctx: ConversionContext,
31563128
target: Target,
31573129
args: Tuple[Argument, ...],
@@ -3177,7 +3149,7 @@ def aten_ops_upsample_bilinear2d_default(
31773149
0: (TRTTensor,),
31783150
}
31793151
)
3180-
def aten_ops_upsample_trilinear3d_default(
3152+
def aten_ops_upsample_trilinear3d(
31813153
ctx: ConversionContext,
31823154
target: Target,
31833155
args: Tuple[Argument, ...],
@@ -3197,41 +3169,13 @@ def aten_ops_upsample_trilinear3d_default(
31973169
)
31983170

31993171

3200-
@dynamo_tensorrt_converter(torch.ops.aten.upsample_linear1d.vec)
3201-
@dynamo_tensorrt_converter(torch.ops.aten.upsample_bilinear2d.vec)
3202-
@dynamo_tensorrt_converter(torch.ops.aten.upsample_trilinear3d.vec)
3203-
@enforce_tensor_types(
3204-
{
3205-
0: (TRTTensor,),
3206-
}
3207-
)
3208-
def aten_ops_upsample_linear_vec(
3209-
ctx: ConversionContext,
3210-
target: Target,
3211-
args: Tuple[Argument, ...],
3212-
kwargs: Dict[str, Argument],
3213-
name: str,
3214-
) -> Union[TRTTensor, Sequence[TRTTensor]]:
3215-
return impl.upsample.upsample(
3216-
ctx,
3217-
target,
3218-
SourceIR.ATEN,
3219-
name,
3220-
args[0],
3221-
size=args_bounds_check(args, 1),
3222-
scale_factor=args_bounds_check(args, 3),
3223-
mode="linear",
3224-
align_corners=args[2],
3225-
)
3226-
3227-
32283172
@dynamo_tensorrt_converter(torch.ops.aten.upsample_bicubic2d.default)
32293173
@enforce_tensor_types(
32303174
{
32313175
0: (TRTTensor,),
32323176
}
32333177
)
3234-
def aten_ops_upsample_bicubic_default(
3178+
def aten_ops_upsample_bicubic2d(
32353179
ctx: ConversionContext,
32363180
target: Target,
32373181
args: Tuple[Argument, ...],
@@ -3251,32 +3195,6 @@ def aten_ops_upsample_bicubic_default(
32513195
)
32523196

32533197

3254-
@dynamo_tensorrt_converter(torch.ops.aten.upsample_bicubic2d.vec)
3255-
@enforce_tensor_types(
3256-
{
3257-
0: (TRTTensor,),
3258-
}
3259-
)
3260-
def aten_ops_upsample_bicubic_vec(
3261-
ctx: ConversionContext,
3262-
target: Target,
3263-
args: Tuple[Argument, ...],
3264-
kwargs: Dict[str, Argument],
3265-
name: str,
3266-
) -> Union[TRTTensor, Sequence[TRTTensor]]:
3267-
return impl.upsample.upsample(
3268-
ctx,
3269-
target,
3270-
SourceIR.ATEN,
3271-
name,
3272-
args[0],
3273-
size=args_bounds_check(args, 1),
3274-
scale_factor=args_bounds_check(args, 3),
3275-
mode="bicubic",
3276-
align_corners=args[2],
3277-
)
3278-
3279-
32803198
@dynamo_tensorrt_converter(
32813199
torch.ops.aten.topk.default, capability_validator=topk_validator
32823200
)

0 commit comments

Comments
 (0)