Caffe2 - C++ API
A deep learning, cross platform ML framework
percentile_op.h
1 // Operator to calculate percentile values for an input tensor of data,
2 // given samples of data from the same distribution, labeled with their
3 // percentile values.
4 
5 #ifndef CAFFE2_OPERATORS_PERCENTILE_OP_H_
6 #define CAFFE2_OPERATORS_PERCENTILE_OP_H_
7 
8 #include "caffe2/core/context.h"
9 #include "caffe2/core/logging.h"
10 #include "caffe2/core/operator.h"
11 #include "caffe2/core/tensor.h"
12 #include "caffe2/utils/math.h"
13 
14 namespace caffe2 {
15 
16 template <class Context>
17 class PercentileOp final : public Operator<Context> {
18  public:
19  USE_OPERATOR_CONTEXT_FUNCTIONS;
20  template <class... Args>
21  explicit PercentileOp(Args&&... args)
22  : Operator<Context>(std::forward<Args>(args)...) {}
23 
24  bool RunOnDevice() override;
25 
26  protected:
27  INPUT_TAGS(X, VAL_PCT_PAIRS, LENS);
28  OUTPUT_TAGS(PCT);
29  Tensor values_tensor;
30  Tensor percentiles_tensor;
31 };
32 
33 } // namespace caffe2
34 
35 #endif // CAFFE2_OPERATORS_PERCENTILE_OP_H_
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13