Caffe2 - C++ API
A deep learning, cross platform ML framework
tensor_protos_db_input.cc
1 #include "caffe2/operators/tensor_protos_db_input.h"
2 
3 namespace caffe2 {
4 REGISTER_CPU_OPERATOR(TensorProtosDBInput, TensorProtosDBInput<CPUContext>);
5 
6 OPERATOR_SCHEMA(TensorProtosDBInput)
7  .NumInputs(1)
8  .NumOutputs(1, INT_MAX)
9  .SetDoc(R"DOC(
10 TensorProtosDBInput is a simple input operator that basically reads things
11 from a db where each key-value pair stores an index as key, and a TensorProtos
12 object as value. These TensorProtos objects should have the same size, and they
13 will be grouped into batches of the given size. The DB Reader is provided as
14 input to the operator and it returns as many output tensors as the size of the
15 TensorProtos object. Each output will simply be a tensor containing a batch of
16 data with size specified by the 'batch_size' argument containing data from the
17 corresponding index in the TensorProtos objects in the DB.
18 )DOC")
19  .Arg("batch_size", "(int, default 0) the number of samples in a batch. The "
20  "default value of 0 means that the operator will attempt to insert the "
21  "entire data in a single output blob.")
22  .Input(0, "data", "A pre-initialized DB reader. Typically, this is obtained "
23  "by calling CreateDB operator with a db_name and a db_type. The "
24  "resulting output blob is a DB Reader tensor")
25  .Output(0, "output", "The output tensor in which the batches of data are "
26  "returned. The number of output tensors is equal to the size of "
27  "(number of TensorProto's in) the TensorProtos objects stored in the "
28  "DB as values. Each output tensor will be of size specified by the "
29  "'batch_size' argument of the operator");
30 
31 NO_GRADIENT(TensorProtosDBInput);
32 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13