Skip to content

Commit

Permalink
[quant][be] Reduce warnings in tests (#108922)
Browse files Browse the repository at this point in the history
Summary:
att

Test Plan:
python test/test_quantization.py TestQuantizePT2E

Reviewers:

Subscribers:

Tasks:

Tags:
Pull Request resolved: #108922
Approved by: https://github.com/andrewor14
ghstack dependencies: #108920, #108921
  • Loading branch information
jerryzh168 authored and pytorchmergebot committed Sep 12, 2023
1 parent 9118073 commit cf26e55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion torch/ao/quantization/pt2e/port_metadata_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


logger = logging.getLogger(__name__)
logger.setLevel(logging.WARNING)
logger.setLevel(logging.ERROR)

__all__ = ["PortNodeMetaForQDQ"]

Expand Down
3 changes: 2 additions & 1 deletion torch/ao/quantization/pt2e/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,14 @@ def fold_bn_weights_into_conv_node(
setattr(m, weight_attr_name, fused_weight)
if conv_bias_node is not None:
bias_attr_name = conv_bias_node.target
setattr(m, bias_attr_name, fused_bias) # type: ignore[arg-type]
else:
bias_attr_name = weight_attr_name + "_bias"
setattr(m, bias_attr_name, fused_bias) # type: ignore[arg-type]
with m.graph.inserting_before(conv_node):
get_bias_node = m.graph.get_attr(bias_attr_name)
# NOTE: here we assume the bias of conv is not quantized!
conv_args[2] = get_bias_node
setattr(m, bias_attr_name, fused_bias) # type: ignore[arg-type]
conv_node.args = tuple(conv_args)

# native_batch_norm has 3 outputs, we expect getitem calls on the output
Expand Down

0 comments on commit cf26e55

Please sign in to comment.