[mir_caffe2] Remove uses of DropoutOp (#6561)
authorСергей Баранников/AI Tools Lab /SRR/Engineer/삼성전자 <s.barannikov@samsung.com>
Tue, 13 Aug 2019 18:33:38 +0000 (21:33 +0300)
committerAlexander Efimov/AI Tools Lab/./Samsung Electronics <a.efimov@samsung.com>
Tue, 13 Aug 2019 18:33:38 +0000 (21:33 +0300)
This operation is a no-op.

Signed-off-by: Sergei Barannikov <s.barannikov@samsung.com>
compiler/mir-caffe2-importer/caffe2_op_creator.cpp

index d48d742..4242ab7 100644 (file)
@@ -23,7 +23,6 @@
 #include "mir/ops/ConstantOp.h"
 #include "mir/ops/Conv2DOp.h"
 #include "mir/ops/DepthwiseConv2DOp.h"
-#include "mir/ops/DropoutOp.h"
 #include "mir/ops/FullyConnectedOp.h"
 #include "mir/ops/InputOp.h"
 #include "mir/ops/MulOp.h"
@@ -426,15 +425,10 @@ Caffe2OpCreator::convertConcat(const std::vector<mir::Operation::Output *> &inpu
 
 std::vector<mir::Operation::Output *>
 Caffe2OpCreator::convertDropout(const std::vector<mir::Operation::Output *> &inputs,
-                                const ::caffe2::OperatorDef &op)
+                                const ::caffe2::OperatorDef &)
 {
-  int is_test = getSingleArgument(op, "is_test", 0);
-  if (is_test)
-    return {inputs[0]};
-
-  float dropout_ratio = getSingleArgument(op, "ratio", 0.5f);
-  auto dropout = createOp<ops::DropoutOp>("Dropout", inputs[0], dropout_ratio);
-  return {dropout->getOutput(0)};
+  // This is a no-op in inference mode.
+  return {inputs[0]};
 }
 
 std::vector<mir::Operation::Output *>