Caffe2 - C++ API
A deep learning, cross platform ML framework
if_op.cc
1 #include "caffe2/operators/if_op.h"
2 
3 namespace caffe2 {
4 
5 REGISTER_CPU_OPERATOR(If, IfOp<CPUContext>);
6 
7 OPERATOR_SCHEMA(If)
8  .NumInputs(1, INT_MAX)
9  .NumOutputs(0, INT_MAX)
10  .SetDoc(R"DOC(
11 'If' control operator, first input is a scalar boolean blob that stores condition
12 value. Accepts 'then_net' (required) and 'else_net' (optional) arguments for 'then' and
13 'else' subnets respectively. Subnets are executed in the same workspace as 'If'.
14  )DOC")
15  .Arg("then_net", "Net executed when condition is true")
16  .Arg("else_net", "Net executed when condition is false (optional)")
17  .Input(0, "condition", "Scalar boolean condition")
18  .AllowInplace([](int in, int out) -> bool { return true; });
19 
20 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13