Skip to content

Commit 8049279

Browse files
committed
[quant][fx] Remove input_output_observed from BinaryOpQuantizeHandler
Summary: when both inputs are scalars, fx tracing will directly calculate the result, instead of generating an op in the fx graph so num_tensor_args will always be greater than 1 for binary ops, so the input_output_observed will always return True for BinaryQuantizeHandler We will remove input_output_observed method after dynamic quantization in qconfig is properly supported Test Plan: python test/test_quantization.py TestQuantizeFx python test/test_quantization.py TestQuantizeFxOps Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 814441c Pull Request resolved: #74776
1 parent 4fe2e2d commit 8049279

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

torch/ao/quantization/fx/quantization_patterns.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,6 @@ def __init__(
199199
def is_general_tensor_value_op(self) -> bool:
200200
return self.num_tensor_args == 1
201201

202-
def input_output_observed(self):
203-
# for x + y where x and y are scalars, we do not observe anything
204-
return self.num_tensor_args > 0
205-
206202
def is_output_quantized(self, qconfig):
207203
dtypes = get_qconfig_dtypes(qconfig)
208204
return self.binary_op in binary_op_supported_dtypes and \

0 commit comments

Comments
 (0)