[mir] Remove Dropout operation (#6675)
authorСергей Баранников/AI Tools Lab /SRR/Engineer/삼성전자 <s.barannikov@samsung.com>
Mon, 19 Aug 2019 18:33:55 +0000 (03:33 +0900)
committerAlexander Efimov/AI Tools Lab/./Samsung Electronics <a.efimov@samsung.com>
Mon, 19 Aug 2019 18:33:55 +0000 (21:33 +0300)
This is a no-op in inference mode.

Signed-off-by: Sergei Barannikov <s.barannikov@samsung.com>
compiler/mir/include/mir/IrDotDumper.h
compiler/mir/include/mir/OpDefs.h
compiler/mir/include/mir/Operations.inc
compiler/mir/include/mir/ops/DropoutOp.h [deleted file]
compiler/mir/src/IrDotDumper.cpp

index c029981..3c44277 100644 (file)
@@ -36,7 +36,6 @@ public:
   void visit(ops::Conv2DOp &op) override;
   void visit(ops::DeConv2DOp &op) override;
   void visit(ops::DepthwiseConv2DOp &op) override;
-  void visit(ops::DropoutOp &op) override;
   void visit(ops::EluOp &op) override;
   void visit(ops::FullyConnectedOp &op) override;
   void visit(ops::GatherOp &op) override;
index 3040d24..7d73d50 100644 (file)
@@ -26,7 +26,6 @@
 #include "mir/ops/Deconv2DOp.h"
 #include "mir/ops/DepthwiseConv2DOp.h"
 #include "mir/ops/DivOp.h"
-#include "mir/ops/DropoutOp.h"
 #include "mir/ops/EluOp.h"
 #include "mir/ops/FullyConnectedOp.h"
 #include "mir/ops/GatherOp.h"
index 3a6b98e..e0acb21 100644 (file)
@@ -26,7 +26,6 @@ HANDLE_OP(conv2D, Conv2DOp)
 HANDLE_OP(deConv2D, DeConv2DOp)
 HANDLE_OP(depthwiseConv, DepthwiseConv2DOp)
 HANDLE_OP(div, DivOp)
-HANDLE_OP(dropout, DropoutOp)
 HANDLE_OP(ELU, EluOp)
 HANDLE_OP(fullyConnected, FullyConnectedOp)
 HANDLE_OP(gather, GatherOp)
diff --git a/compiler/mir/include/mir/ops/DropoutOp.h b/compiler/mir/include/mir/ops/DropoutOp.h
deleted file mode 100644 (file)
index 4ebbe76..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _MIR_OPS_DROPOUT_OP_H_
-#define _MIR_OPS_DROPOUT_OP_H_
-
-#include "mir/Operation.h"
-
-namespace mir
-{
-namespace ops
-{
-
-class DropoutOp : public Operation
-{
-public:
-  DropoutOp(Output *arg, float rate) : Operation(Type::dropout, {arg}), _rate(rate)
-  {
-    // Infer output shape.
-    setOutputShape(0, getInputShape(0));
-  }
-
-  Operation *copyWithInputs(const std::vector<Output *> &inputs) override
-  {
-    return new DropoutOp(inputs[0], _rate);
-  }
-
-  /**
-   * @return The ratio of random dropout
-   */
-  float getRate() const { return _rate; }
-
-private:
-  float _rate;
-};
-
-} // namespace ops
-} // namespace mir
-
-#endif //_MIR_OPS_DROPOUT_OP_H_
index df0220e..a683107 100644 (file)
@@ -179,16 +179,6 @@ void IrDotDumper::visit(ops::SliceOp &op)
   _dot_builder.updateWithOp(&op, node_info);
 }
 
-void IrDotDumper::visit(ops::DropoutOp &op)
-{
-  auto nodeInfo = DotIrNodeInfo()
-                      .withType("DropoutOp", op.getName())
-                      .withInShapes(getInputShapes(op))
-                      .withOutShapes(getOutputShapes(op))
-                      .withMisc("DropRate", op.getRate());
-  _dot_builder.updateWithOp(&op, nodeInfo);
-}
-
 void IrDotDumper::visit(ops::DeConv2DOp &op)
 {
   auto node_info = DotIrNodeInfo()