Caffe2 - C++ API
A deep learning, cross platform ML framework
unique_ops.h
1 
17 #ifndef CAFFE_OPERATORS_UNIQUE_OPS_H_
18 #define CAFFE_OPERATORS_UNIQUE_OPS_H_
19 
20 #include <cmath>
21 
22 #include "caffe2/core/context.h"
23 #include "caffe2/core/logging.h"
24 #include "caffe2/core/operator.h"
25 #include "caffe2/core/types.h"
26 #include "caffe2/utils/math.h"
27 
28 namespace caffe2 {
29 
35 template <class Context>
36 class UniqueOp : public Operator<Context> {
37  public:
38  USE_OPERATOR_CONTEXT_FUNCTIONS;
39  USE_SIMPLE_CTOR_DTOR(UniqueOp)
40 
41  bool RunOnDevice() override {
43  }
44 
45  template <typename T>
46  bool DoRunWithType();
47 
48  private:
49  vector<int> order_;
50  Tensor thrust_unique_buffer_;
51  Tensor cuda_order_buffer_{Context::GetDeviceType()};
52  Tensor second_order_buffer_{Context::GetDeviceType()};
53 
54  public:
55  OUTPUT_TAGS(UNIQUE, REMAPPING);
56 };
57 
58 } // namespace caffe2
59 
60 #endif // CAFFE_OPERATORS_UNIQUE_OPS_H_
const Tensor & Input(int idx, DeviceType type=Context::GetDeviceType())
Retrieve a non-owning reference to the input at position &#39;idx&#39; for this operator. ...
Definition: operator.h:702
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13
Deduplicates input indices vector and optionally produces reverse remapping.
Definition: unique_ops.h:36