Caffe2 - C++ API
A deep learning, cross platform ML framework
accuracy_op.h
1 
17 #ifndef CAFFE2_OPERATORS_ACCURACY_OP_H_
18 #define CAFFE2_OPERATORS_ACCURACY_OP_H_
19 
20 #include "caffe2/core/context.h"
21 #include "caffe2/core/operator.h"
22 
23 namespace caffe2 {
24 
25 template <typename T, class Context>
26 class AccuracyOp final : public Operator<Context> {
27  public:
28  USE_OPERATOR_CONTEXT_FUNCTIONS;
29  AccuracyOp(const OperatorDef& operator_def, Workspace* ws)
30  : Operator<Context>(operator_def, ws),
31  top_k_(OperatorBase::GetSingleArgument<int>("top_k", 1)) {}
32 
33  bool RunOnDevice() override;
34 
35  protected:
36  int top_k_;
37  INPUT_TAGS(PREDICTION, LABEL);
38 };
39 
40 } // namespace caffe2
41 
42 #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:63
Copyright (c) 2016-present, Facebook, Inc.