Caffe2 - C++ API
A deep learning, cross platform ML framework
accuracy_op.h
1 #ifndef CAFFE2_OPERATORS_ACCURACY_OP_H_
2 #define CAFFE2_OPERATORS_ACCURACY_OP_H_
3 
4 #include "caffe2/core/context.h"
5 #include "caffe2/core/operator.h"
6 
7 namespace caffe2 {
8 
9 template <typename T, class Context>
10 class AccuracyOp final : public Operator<Context> {
11  public:
12  USE_OPERATOR_CONTEXT_FUNCTIONS;
13  AccuracyOp(const OperatorDef& operator_def, Workspace* ws)
14  : Operator<Context>(operator_def, ws),
15  top_k_(OperatorBase::GetSingleArgument<int>("top_k", 1)) {}
16 
17  bool RunOnDevice() override;
18 
19  protected:
20  int top_k_;
21  INPUT_TAGS(PREDICTION, LABEL);
22 };
23 
24 } // namespace caffe2
25 
26 #endif // CAFFE2_OPERATORS_ACCURACY_OP_H_
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 ...