Caffe2 - C++ API
A deep learning, cross platform ML framework
while_op.cc
1 
17 #include "caffe2/operators/while_op.h"
18 
19 namespace caffe2 {
20 
21 REGISTER_CPU_OPERATOR(While, WhileOp<CPUContext>);
22 
23 OPERATOR_SCHEMA(While)
24  .NumInputs(1, INT_MAX)
25  .NumOutputs(0, INT_MAX)
26  .SetDoc(R"DOC(
27 'While' control operator, first input is a scalar boolean blob that stores loop's
28 condition value. Accepts 'loop_net' (required) and 'cond_net' (optional) arguments for
29 loop's body and condition subnets respectively. If condition subnet is specified,
30 it is executed before the first and after each iteration. Subnets are executed in
31 the same workspace as 'While'.
32  )DOC")
33  .Arg("loop_net", "Net executed on each iteration")
34  .Arg("cond_net", "Net to (re)compute condition value")
35  .Input(0, "condition", "Scalar boolean condition")
36  .AllowInplace([](int in, int out) -> bool { return true; });
37 
38 } // namespace caffe2
Copyright (c) 2016-present, Facebook, Inc.