1 #include "caffe2/queue/blobs_queue_db.h" 8 #include "caffe2/core/context.h" 9 #include "caffe2/core/logging.h" 10 #include "caffe2/core/operator.h" 11 #include "caffe2/queue/blobs_queue.h" 16 template <
class Context>
22 bool RunOnDevice()
override {
23 std::unique_ptr<db::DB> db = caffe2::make_unique<BlobsQueueDB>(
26 OperatorBase::Input<std::shared_ptr<BlobsQueue>>(0),
27 OperatorBase::template GetSingleArgument<int>(
"key_blob_index", -1),
28 OperatorBase::template GetSingleArgument<int>(
"value_blob_index", 0),
29 OperatorBase::template GetSingleArgument<float>(
"timeout_secs", 0.0));
30 OperatorBase::Output<db::DBReader>(0)->Open(std::move(db), 1, 0);
40 OPERATOR_SCHEMA(CreateBlobsQueueDB)
45 "(default: -1 (no key)) index of blob for DB key in the BlobsQueue.")
48 "(default: 0) index of blob for DB value in the BlobsQueue.")
51 "(default: 0.0 (no timeout)) Timeout in seconds for reading from the " 53 .SetDoc(
"Create a DBReader from a BlobsQueue")
54 .Input(0,
"queue",
"The shared pointer to a queue containing Blobs.")
55 .Output(0,
"reader",
"The DBReader for the given BlobsQueue");
57 SHOULD_NOT_DO_GRADIENT(CreateBlobsQueueDB);
Workspace is a class that holds all the related objects created during runtime: (1) all blobs...
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...