Caffe2 - C++ API
A deep learning, cross platform ML framework
channel_stats_op.h
1 #ifndef CAFFE2_OPERATORS_CHANNEL_STATS_OP_H
2 #define CAFFE2_OPERATORS_CHANNEL_STATS_OP_H
3 
4 #include "caffe2/core/context.h"
5 #include "caffe2/core/operator.h"
6 #include "caffe2/utils/math.h"
7 
8 namespace caffe2 {
9 
10 template <class Context>
11 class ChannelStatsOp : public Operator<Context> {
12  public:
13  USE_OPERATOR_CONTEXT_FUNCTIONS;
14  ChannelStatsOp(const OperatorDef& operator_def, Workspace* ws)
15  : Operator<Context>(operator_def, ws) {}
16  ~ChannelStatsOp() {}
17 
18  bool RunOnDevice() override {
19  return true;
20  }
21 
22  protected:
23  INPUT_TAGS(INPUT);
24  OUTPUT_TAGS(SUM, SUMSQ);
25 
26  Tensor<Context> sumScratch_;
27  Tensor<Context> sumsqScratch_;
28 };
29 
30 } // namespace caffe2
31 
32 #endif // CAFFE2_OPERATORS_CHANNEL_STATS_OP_H
Tensor is the basic class in Caffe2 that stores a contiguous memory with its shape information...
Definition: tensor.h:93
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 ...