Skip to content

Commit 2cbb204

Browse files
committed
update config
Signed-off-by: Sun, Xuehao <[email protected]>
1 parent 97ee9c3 commit 2cbb204

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ repos:
8888
hooks:
8989
- id: black
9090
files: (.*\.py)$
91+
exclude: |
92+
(?x)^(
93+
neural_compressor/conf/config.py|
94+
neural_compressor/conf/pythonic_config.py
95+
)$
9196
9297
- repo: https://github.com/asottile/blacken-docs
9398
rev: 1.16.0

neural_compressor/adaptor/tf_utils/quantize_graph/qdq/fuse_qdq_conv.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def __init__(self, **kwargs):
3737
key=lambda i: len(i),
3838
reverse=True)
3939
if self.new_api:
40+
# fmt: off
4041
self.fusion_mapping = {
4142
'DequantizeConv2DBiasAddQuantizeV2': self.apply_newly_conv_biasadd_fusion,
4243
'DequantizeConv2DBiasAddAddNReluQuantizeV2': self.apply_newly_conv_biasadd_addn_relu_fusion,
@@ -127,6 +128,7 @@ def __init__(self, **kwargs):
127128
'DequantizeConv3DAddLeakyReluQuantizeV2': self.apply_conv3d_add_relu_fusion,
128129
'DequantizeDepthwiseConv2dNativeQuantizeV2': self.apply_newly_conv_single_fusion
129130
}
131+
# fmt: on
130132

131133
def _insert_dummy_biasadd(self, match_node_name, matched_node):
132134
"""Insert dummy biasadd for fusion."""

neural_compressor/experimental/data/transforms/transform.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2680,12 +2680,14 @@ class ParseDecodeVocTransform(BaseTransform):
26802680
tuple of parsed image and labels
26812681
"""
26822682

2683+
# fmt: off
26832684
def __call__(self, sample):
26842685
"""Parse decode voc."""
26852686
# Currently only supports jpeg and png.
26862687
# Need to use this logic because the shape is not known for
26872688
# tf.image.decode_image and we rely on this info to
26882689
# extend label if necessary.
2690+
# fmt: on
26892691
def _decode_image(content, channels):
26902692
"""Decode the image with content."""
26912693
return tf.cond(

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ ignore = [
2929
"E402", # Module level import not at top of file
3030
"E501", # Line too long (121 > 120 characters)
3131
"E721", # Do not compare types, use isinstance()
32+
"E731", # Do not assign a lambda expression, use a def
3233
"E722", # Do not use bare except
3334
"E741", # Do not use variables named ‘l’, ‘O’, or ‘I’
3435
"F401", # {name} imported but unused

0 commit comments

Comments
 (0)