Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automatic Pre-CI code-scan bug fix tool #1134

Merged
merged 26 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update config
Signed-off-by: Sun, Xuehao <xuehao.sun@intel.com>
  • Loading branch information
XuehaoSun committed Aug 25, 2023
commit 204d29ad727c4047adec3607b946d1fddba421b8
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ exclude: |
neural_coder/examples/.+|
examples/.+|
neural_compressor/adaptor/ox_utils/calibrator.py|
neural_compressor/adaptor/ox_utils/calibration.py
neural_compressor/adaptor/ox_utils/calibration.py|
neural_compressor/adaptor/ox_utils/quantizer.py|
neural_compressor/objective.py
)$

repos:
Expand Down
6 changes: 4 additions & 2 deletions neural_compressor/compression/distillation/criterions.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,8 @@ def __init__(self, layer_mappings=[], loss_types=None, loss_weights=None,
self.feature_matchers = None
self.init_loss_funcs()
assert len(self.layer_mappings) == len(self.loss_weights) == len(self.loss_types), \
f'Wrong length for layer_mappings:{self.layer_mappings}, loss_weights:{self.loss_weights} or loss_types:{self.loss_types}, ' + \
f'Wrong length for layer_mappings:{self.layer_mappings}, ' + \
f'loss_weights:{self.loss_weights} or loss_types:{self.loss_types}, ' + \
'all should be the same.'

def init_loss_funcs(self):
Expand Down Expand Up @@ -1184,7 +1185,8 @@ def __init__(self, layer_mappings=[], loss_types=None, loss_weights=None, temper
self.loss_funcs = []
self.init_loss_funcs()
assert len(self.layer_mappings) == len(self.loss_weights) == len(self.loss_types), \
f'Wrong length for layer_mappings:{self.layer_mappings}, loss_weights:{self.loss_weights} or loss_types:{self.loss_types}, ' + \
f'Wrong length for layer_mappings:{self.layer_mappings}, ' + \
f'loss_weights:{self.loss_weights} or loss_types:{self.loss_types}, ' + \
'all should be the same.'

def init_loss_funcs(self):
Expand Down
6 changes: 4 additions & 2 deletions neural_compressor/experimental/common/criterion.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,8 @@ def __init__(self, layer_mappings=[], loss_types=None, loss_weights=None,
self.feature_matchers = None
self.init_loss_funcs()
assert len(self.layer_mappings) == len(self.loss_weights) == len(self.loss_types), \
f'Wrong length for layer_mappings:{self.layer_mappings}, loss_weights:{self.loss_weights} or loss_types:{self.loss_types}, ' + \
f'Wrong length for layer_mappings:{self.layer_mappings}, ' + \
f'loss_weights:{self.loss_weights} or loss_types:{self.loss_types}, ' + \
'all should be the same.'

def init_loss_funcs(self):
Expand Down Expand Up @@ -1285,7 +1286,8 @@ def __init__(self, layer_mappings=[], loss_types=None, loss_weights=None, temper
self.loss_funcs = []
self.init_loss_funcs()
assert len(self.layer_mappings) == len(self.loss_weights) == len(self.loss_types), \
f'Wrong length for layer_mappings:{self.layer_mappings}, loss_weights:{self.loss_weights} or loss_types:{self.loss_types}, ' + \
f'Wrong length for layer_mappings:{self.layer_mappings}, ' + \
f'loss_weights:{self.loss_weights} or loss_types:{self.loss_types}, ' + \
'all should be the same.'

def init_loss_funcs(self):
Expand Down