17 #ifndef SELECT_SMOOTH_L1_LOSS_OP_H_ 18 #define SELECT_SMOOTH_L1_LOSS_OP_H_ 20 #include "caffe2/core/context.h" 21 #include "caffe2/core/logging.h" 22 #include "caffe2/core/operator.h" 23 #include "caffe2/utils/math.h" 27 template <
typename T,
class Context>
32 beta_(this->
template GetSingleArgument<float>(
"beta", 1.)),
33 scale_(this->
template GetSingleArgument<float>(
"scale", 1.)) {
34 CAFFE_ENFORCE(beta_ > 0);
35 CAFFE_ENFORCE(scale_ >= 0);
37 USE_OPERATOR_CONTEXT_FUNCTIONS;
39 bool RunOnDevice()
override {
41 CAFFE_NOT_IMPLEMENTED;
48 Tensor buff_{Context::GetDeviceType()};
51 template <
typename T,
class Context>
56 beta_(this->
template GetSingleArgument<float>(
"beta", 1.)),
57 scale_(this->
template GetSingleArgument<float>(
"scale", 1.)) {
58 CAFFE_ENFORCE(beta_ > 0);
59 CAFFE_ENFORCE(scale_ >= 0);
61 USE_OPERATOR_CONTEXT_FUNCTIONS;
63 bool RunOnDevice()
override {
65 CAFFE_NOT_IMPLEMENTED;
72 Tensor buff_{Context::GetDeviceType()};
77 #endif // SELECT_SMOOTH_L1_LOSS_OP_H_
Workspace is a class that holds all the related objects created during runtime: (1) all blobs...
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...