Caffe2 - C++ API
A deep learning, cross platform ML framework
feed_blob_op.h
1 #ifndef CAFFE2_OPERATORS_FEED_BLOB_OP_H_
2 #define CAFFE2_OPERATORS_FEED_BLOB_OP_H_
3 
4 #include "caffe2/core/context.h"
5 #include "caffe2/core/operator.h"
6 
7 namespace caffe2 {
8 
9 template <class Context>
10 class FeedBlobOp : public Operator<Context> {
11  public:
12  FeedBlobOp(const OperatorDef& def, Workspace* ws)
13  : Operator<Context>(def, ws) {
14  CAFFE_ENFORCE(
15  OperatorBase::HasSingleArgumentOfType<string>("value"),
16  "value argument must exist and be passed as a string");
17  value_ = OperatorBase::GetSingleArgument<string>("value", "");
18  }
19 
20  bool RunOnDevice() override {
21  *OperatorBase::Output<std::string>(0) = value_;
22  return true;
23  }
24 
25  private:
26  std::string value_;
27 };
28 
29 } // namespace caffe2
30 
31 #endif
Workspace is a class that holds all the related objects created during runtime: (1) all blobs...
Definition: workspace.h:47
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...