Skip to content

Commit 1b2d668

Browse files
cherry pick 3663: fix the int8 quantization error, remove duplicated lines (#3665)
1 parent b6cf8e5 commit 1b2d668

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

py/torch_tensorrt/dynamo/conversion/impl/quantize.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def quantize(
4545
Adds quantize and dequantize ops (QDQ) which quantize to INT8 or FP8 based
4646
on the output_type set and dequantizes them back.
4747
"""
48-
4948
with unset_fake_temporarily():
5049
if isinstance(input_tensor, (torch.Tensor, TRTTensor)):
5150
if input_tensor.dtype not in (
@@ -118,8 +117,6 @@ def quantize(
118117
if not isinstance(input_tensor, TRTTensor):
119118
input_tensor = get_trt_tensor(ctx, input_tensor, name + "_quantize_input")
120119

121-
quantize_layer = ctx.net.add_quantize(input_tensor, scale, dtype)
122-
123120
# Add Q node
124121
quantize_layer = ctx.net.add_quantize(input_tensor, scale, dtype)
125122
if axis is not None:

0 commit comments

Comments
 (0)