Caffe2 - C++ API
A deep learning, cross platform ML framework
flexible_top_k.h
1 // Copyright 2004-present Facebook. All Rights Reserved.
2 
3 #ifndef CAFFE2_OPERATORS_FLEXIBLE_TOP_K_H_
4 #define CAFFE2_OPERATORS_FLEXIBLE_TOP_K_H_
5 
6 #include "caffe2/core/logging.h"
7 #include "caffe2/core/operator.h"
8 #include "caffe2/utils/math.h"
9 
10 namespace caffe2 {
11 
12 template <typename T, class Context>
13 class FlexibleTopKOp : public Operator<Context> {
14  public:
15  USE_OPERATOR_CONTEXT_FUNCTIONS;
16 
17  template <class... Args>
18  explicit FlexibleTopKOp(Args&&... args)
19  : Operator<Context>(std::forward<Args>(args)...) {}
20 
21  bool RunOnDevice() override;
22 };
23 
24 template <typename T, class Context>
25 class FlexibleTopKGradientOp : public Operator<Context> {
26  public:
27  USE_OPERATOR_CONTEXT_FUNCTIONS;
28 
29  template <class... Args>
30  explicit FlexibleTopKGradientOp(Args&&... args)
31  : Operator<Context>(std::forward<Args>(args)...) {}
32 
33  bool RunOnDevice() override;
34 };
35 
36 } // namespace caffe2
37 
38 #endif // CAFFE2_OPERATORS_FLEXIBLE_TOP_K_H_
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13