-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Support 'op_partial_names' in config_list #4184
Conversation
} | ||
|
||
INTERNAL_SCHEMA = { | ||
'total_sparsity': And(float, lambda n: 0 <= n < 1), | ||
SchemaOptional('max_sparsity_per_layer'): {str: float}, | ||
SchemaOptional('op_types'): [str], | ||
SchemaOptional('op_names'): [str] | ||
SchemaOptional('op_names'): [str], | ||
SchemaOptional('op_partial_names'): [str] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
op_partial_names
should not in INTERNAL_SCHEMA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I got it. And next I will add something in need in 'config_validation.py' as well.
raise SchemaError('At least one of the followings must be specified: op_types, op_names or op_partial_names.') | ||
|
||
if 'op_partial_names' in data: | ||
if 'op_names' in data: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use and
config['op_names'].extend(op_names) | ||
config['op_names'] = list(set(config['op_names'])) | ||
else: | ||
config['op_names'] = config.pop('op_partial_names') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why config['op_names'] = config.pop('op_partial_names')
? seems this config['op_names']
is never used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some legacy logic parts have crushed and I optimized this jut now : (
You now could use 'op_partial_names' instead of 'op_names' in config_list