1 #ifndef CAFFE_OPERATORS_BATCH_BOX_COX_OPS_H_ 2 #define CAFFE_OPERATORS_BATCH_BOX_COX_OPS_H_ 4 #include "caffe2/core/context.h" 5 #include "caffe2/core/logging.h" 6 #include "caffe2/core/operator.h" 7 #include "caffe2/utils/math.h" 11 template <
class Context>
14 USE_OPERATOR_CONTEXT_FUNCTIONS;
15 template <
class... Args>
19 this->
template GetSingleArgument<int>(
"min_block_size", 256)) {}
21 bool RunOnDevice()
override {
41 void BoxCoxNonzeroLambda(
50 void BoxCoxZeroLambda(
58 void BoxCoxMixedLambda(
60 const vector<int>& nonzeros,
61 const vector<int>& zeros,
69 vector<int> nonzeros_, zeros_;
72 struct CachedBuffers {
73 virtual ~CachedBuffers() {}
77 struct TypedCachedBuffers :
public CachedBuffers {
78 vector<T> lambda1_, lambda2_, lambda2_z_;
79 vector<T> accumulator_;
82 TypedCachedBuffers<T>& GetBuffers();
83 unique_ptr<CachedBuffers> buffers_;
85 #endif // CAFFE2_USE_MKL 89 INPUT_TAGS(DATA, LAMBDA1, LAMBDA2);
94 #endif // CAFFE_OPERATORS_BATCH_BOX_COX_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 ...