Skip to content

Commit

Permalink
Merge pull request #617 from take-cheeze/opt_disable_per_channel_quan…
Browse files Browse the repository at this point in the history
…tize

Add --disable_per_channel_quantize option
  • Loading branch information
take-cheeze authored Aug 27, 2019
2 parents 09c85e3 + eeb6612 commit b8ba8b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler/passes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ void RunDefaultPasses(Graph* graph, bool gen_backprop, bool skip_scheduling) {

if (g_quantize) {
QuantizationOptions q_opts;
q_opts.per_channel = !g_disable_per_channel_quantize;
Recursively([q_opts](Graph* graph) { Quantize(q_opts, graph); }, graph);
}

Expand Down
4 changes: 4 additions & 0 deletions scripts/generate_flags_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@
'type': 'bool',
'doc': 'Quantize ONNX model'
},
'disable_per_channel_quantize': {
'type': 'bool',
'doc': 'Disables per channel quantization'
},

'computation_order': {
'type': 'std::string',
Expand Down

0 comments on commit b8ba8b5

Please sign in to comment.