Skip to content

Commit

Permalink
[one-cmds] Make argument group for force_quantparam (Samsung#7915)
Browse files Browse the repository at this point in the history
This makes argument group for force_quantparam in one-quantize.

ONE-DCO-1.0-Signed-off-by: Hyukjin Jeong <[email protected]>
Co-authored-by: seongwoo chae <[email protected]>
  • Loading branch information
jinevening and mhs4670go authored Nov 3, 2021
1 parent a240e85 commit e3208fd
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions compiler/one-cmds/one-quantize
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,21 @@ def _get_parser():
"calibration algorithm for post-training quantization (supported: percentile/moving_average, default=percentile). 'percentile' mode uses the n-th percentiles as min/max values. 'moving_average' mode records the moving average of min/max."
)

# arguments for force_quantparam
parser.add_argument(
# arguments for force_quantparam option
force_quantparam_group = parser.add_argument_group(
'arguments for force_quantparam option')

force_quantparam_group.add_argument(
'--force_quantparam',
action='store_true',
help='write quantparam to the specified tensor')
parser.add_argument(
help=
'overwrite quantparam (scale, zero_point) to the specified tensor in the quantized model.'
)
force_quantparam_group.add_argument(
'--tensor_name', type=str, action='append', help='tensor name (string)')
parser.add_argument('--scale', type=float, action='append', help='scale (float)')
parser.add_argument(
force_quantparam_group.add_argument(
'--scale', type=float, action='append', help='scale (float)')
force_quantparam_group.add_argument(
'--zero_point', type=int, action='append', help='zero point (int)')

return parser
Expand Down

0 comments on commit e3208fd

Please sign in to comment.