Skip to content

Commit 7460af8

Browse files
committed
Eliminate dropout by custom onnx optimizer
1 parent c766981 commit 7460af8

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

third_party/onnx

Submodule onnx updated 833 files

tools/onnx2bnn/OnnxConverter.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ std::vector<std::string> OnnxConverter::Convert(
193193
// for details.
194194
vector<string> optimizers{
195195
"eliminate_nop_pad", "extract_constant_to_initializer",
196+
"dabnn_eliminate_dropout",
196197
"dabnn_convert_gemm_with_reshape_or_flatten_to_conv_and_reshape",
197198
"dabnn_bconv_strict"};
198199
if (level == Level::kModerate || level == Level::kAggressive) {
@@ -510,11 +511,6 @@ std::vector<std::string> OnnxConverter::Convert(
510511
0, 0, 0, 0, 0, 0, param);
511512
layers_.push_back(layer);
512513
VLOG(5) << "Converting Concat completed";
513-
} else if (op == "Dropout") {
514-
VLOG(5) << "Start converting Dropout";
515-
// Dropout does nothing, so the output is the same as the input
516-
name_map_[node.output(0)] = m(node.input(0));
517-
VLOG(5) << "Converting Dropout completed";
518514
} else if (op == "Reshape") {
519515
VLOG(5) << "Start converting Reshape";
520516
has_reshape = true;

0 commit comments

Comments
 (0)