Skip to content

Commit d3b4a24

Browse files
authored
Fix T248482926
Differential Revision: D89898065 Pull Request resolved: pytorch#16409
1 parent de7dc35 commit d3b4a24

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

‎backends/cadence/aot/replace_ops.py‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919

2020
import torch
2121
import torch.fx
22-
from executorch.backends.cadence.aot.compiler_utils import (
23-
get_zero_point,
24-
quantize_tensor_multiplier,
25-
)
22+
from executorch.backends.cadence.aot.compiler_utils import quantize_tensor_multiplier
2623
from executorch.backends.cadence.aot.fuse_ops import (
2724
FuseCascadedTransposeOrPermuteOps,
2825
FuseCascadedViewOps,
@@ -1463,10 +1460,12 @@ def maybe_remove_or_replace(self, node: torch.fx.Node) -> bool:
14631460
kernel_size = list(weight_shape[1:-1] if channel_last else weight_shape[2:])
14641461
# If the transposed_convolution op was quantized, we need the input tensor's
14651462
# zero_point for im2row. Otherwise in_zero_point defaults to a zero
1466-
# tensor.
1463+
# tensor. For quantized ops, the input_zero_point is at args[8] as an int,
1464+
# and we need to convert it to a tensor since transposed_im2row expects
1465+
# a Tensor for in_zero_point (unlike im2row which expects an int).
14671466
assert isinstance(in_tensor, torch.fx.Node)
14681467
in_zero_point = (
1469-
get_zero_point(in_tensor.meta["val"])
1468+
torch.tensor(node.args[8], dtype=torch.int32)
14701469
if quantized_op
14711470
else torch.tensor(0, dtype=torch.int32)
14721471
)

0 commit comments

Comments
 (0)