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  template <class... Args>
14  explicit AccuracyOp(Args&&... args)
15  : Operator<Context>(std::forward<Args>(args)...),
16  top_k_(this->template GetSingleArgument<int>("top_k", 1)) {}
17 
18  bool RunOnDevice() override;
19 
20  protected:
21  int top_k_;
22  INPUT_TAGS(PREDICTION, LABEL);
23 };
24 
25 } // namespace caffe2
26 
27 #endif // CAFFE2_OPERATORS_ACCURACY_OP_H_
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13