Caffe2 - C++ API
A deep learning, cross platform ML framework
do_op.cc
1 
17 #include "caffe2/operators/do_op.h"
18 
19 namespace caffe2 {
20 
21 REGISTER_CPU_OPERATOR(Do, DoOp<CPUContext>);
22 
23 OPERATOR_SCHEMA(Do)
24  .NumInputs(1, INT_MAX)
25  .NumOutputs(1, INT_MAX)
26  .SetDoc(R"DOC(
27 'Do' control operator, executes a subnet in a separate workspace.
28 Last blobs in the input and output lists should be the same blob created with
29 CreateScope op. Arguments 'inner_blobs' and 'outer_blobs_idx' provide a mapping
30 between selected inner blob names and corresponding outer blob indices.
31  )DOC")
32  .Arg("net", "Subnet with blob bindings")
33  .Arg(
34  "inner_blobs",
35  "List of inner net blob names to bind to outer workspace")
36  .Arg(
37  "outer_blobs_idx",
38  "Indices of corresponding outer workspace blobs, "
39  "in order: operator inputs, operator outputs (skipping workspace blobs)")
40  .Arg(
41  "saved_fwd_blobs",
42  "List of blobs from the forward Do operator workspace needed "
43  "in backward pass, used in gradient Do operator")
44  .Arg(
45  "reuse_workspace",
46  "Whether to reuse workspace or create a new one in a given scope")
47  .AllowInplace([](int in, int out) -> bool { return true; });
48 
49 } // namespace caffe2
Copyright (c) 2016-present, Facebook, Inc.