summaryrefslogtreecommitdiff
path: root/caffe2/operators/if_op.h
diff options
context:
space:
mode:
authorArtem Volkhin <volkhin@fb.com>2017-08-25 23:56:05 -0700
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2017-08-26 00:07:58 -0700
commitd3c8e68004c118b4bd00cd1d33a3fb549ce9a605 (patch)
tree495c0550b1c5ae9f98e0b1499c0fa2ddf5e5ceff /caffe2/operators/if_op.h
parent9f693b39aa747188c500d753de20fbf0db39d0a1 (diff)
downloadpytorch-d3c8e68004c118b4bd00cd1d33a3fb549ce9a605.tar.gz
pytorch-d3c8e68004c118b4bd00cd1d33a3fb549ce9a605.tar.bz2
pytorch-d3c8e68004c118b4bd00cd1d33a3fb549ce9a605.zip
Revert D5641588: [caffe2] Control flow operators
Summary: This reverts commit f9e04429961c3da7da4ebca3e8163bfcc2a09ec9 bypass-lint Differential Revision: D5641588 fbshipit-source-id: bb23b213d08e9c3ea509216fce9367625943d007
Diffstat (limited to 'caffe2/operators/if_op.h')
-rw-r--r--caffe2/operators/if_op.h44
1 files changed, 0 insertions, 44 deletions
diff --git a/caffe2/operators/if_op.h b/caffe2/operators/if_op.h
deleted file mode 100644
index 5b3eb8efbb..0000000000
--- a/caffe2/operators/if_op.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef CAFFE2_OPERATORS_IF_OP_H_
-#define CAFFE2_OPERATORS_IF_OP_H_
-
-#include "caffe2/core/context.h"
-#include "caffe2/core/logging.h"
-#include "caffe2/core/operator.h"
-
-namespace caffe2 {
-
-template <class Context>
-class IfOp final : public Operator<Context> {
- public:
- IfOp(const OperatorDef& operator_def, Workspace* ws)
- : Operator<Context>(operator_def, ws) {
- CAFFE_ENFORCE(
- this->template HasSingleArgumentOfType<NetDef>("then_net"),
- "then_net must be specified in If operator");
- then_net_def_ =
- this->template GetSingleArgument<NetDef>("then_net", NetDef());
- then_net_ = ws->CreateNet(then_net_def_, true);
- CAFFE_ENFORCE(then_net_, "Failed to initialize then subnet");
-
- if (this->template HasSingleArgumentOfType<NetDef>("else_net")) {
- else_net_def_ =
- this->template GetSingleArgument<NetDef>("else_net", NetDef());
- else_net_ = ws->CreateNet(else_net_def_, true);
- CAFFE_ENFORCE(else_net_, "Failed to initialize else subnet");
- }
- }
-
- USE_OPERATOR_CONTEXT_FUNCTIONS;
- bool RunOnDevice() override;
-
- private:
- NetDef then_net_def_;
- NetBase* then_net_ = nullptr;
-
- NetDef else_net_def_;
- NetBase* else_net_ = nullptr;
-};
-
-} // namespace caffe2
-
-#endif // CAFFE2_OPERATORS_IF_OP_H_