Caffe2 - C++ API
A deep learning, cross platform ML framework
batch_permutation_op.h
1 
17 #ifndef BATCHPERMUTATION_OP_H_
18 #define BATCHPERMUTATION_OP_H_
19 
20 #include <cstring>
21 #include "caffe2/core/context.h"
22 #include "caffe2/core/logging.h"
23 #include "caffe2/core/operator.h"
24 #include "caffe2/utils/math.h"
25 
26 namespace caffe2 {
27 
28 template <typename T, class Context>
29 class BatchPermutationOp final : public Operator<Context> {
30  public:
31  BatchPermutationOp(const OperatorDef& operator_def, Workspace* ws)
32  : Operator<Context>(operator_def, ws) {}
33  USE_OPERATOR_CONTEXT_FUNCTIONS;
34 
35  bool RunOnDevice() override;
36 };
37 
38 template <typename T, class Context>
39 class BatchPermutationGradientOp final : public Operator<Context> {
40  public:
41  BatchPermutationGradientOp(const OperatorDef& def, Workspace* ws)
42  : Operator<Context>(def, ws) {}
43  USE_OPERATOR_CONTEXT_FUNCTIONS;
44 
45  bool RunOnDevice() override {
46  // No CPU implementation for now
47  CAFFE_NOT_IMPLEMENTED;
48  }
49 };
50 
51 } // namespace caffe2
52 
53 #endif // BATCHPERMUTATION_OP_H_
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 ...
Definition: blob.h:13