1 #ifndef CAFFE2_DB_CREATE_DB_OP_H_ 2 #define CAFFE2_DB_CREATE_DB_OP_H_ 4 #include "caffe2/core/context.h" 5 #include "caffe2/core/db.h" 6 #include "caffe2/core/operator.h" 10 template <
class Context>
15 db_type_(OperatorBase::template GetSingleArgument<string>(
18 db_name_(OperatorBase::template GetSingleArgument<string>(
"db",
"")),
20 OperatorBase::template GetSingleArgument<int>(
"num_shards", 1)),
22 OperatorBase::template GetSingleArgument<int>(
"shard_id", 0)) {
23 CAFFE_ENFORCE_GT(db_name_.size(), 0,
"Must specify a db name.");
26 bool RunOnDevice()
final {
27 OperatorBase::Output<db::DBReader>(0)->Open(
28 db_type_, db_name_, num_shards_, shard_id_);
42 #endif // CAFFE2_DB_CREATE_DB_OP_H_
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 ...