17 #ifndef CAFFE_OPERATORS_UNIQUE_OPS_H_ 18 #define CAFFE_OPERATORS_UNIQUE_OPS_H_ 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" 35 template <
class Context>
38 USE_OPERATOR_CONTEXT_FUNCTIONS;
41 bool RunOnDevice()
override {
50 Tensor thrust_unique_buffer_;
51 Tensor cuda_order_buffer_{Context::GetDeviceType()};
52 Tensor second_order_buffer_{Context::GetDeviceType()};
55 OUTPUT_TAGS(UNIQUE, REMAPPING);
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 'idx' for this operator. ...
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Deduplicates input indices vector and optionally produces reverse remapping.