17 #ifndef SMOOTH_L1_LOSS_OP_H_ 18 #define 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;
47 Tensor buff_{Context::GetDeviceType()};
50 template <
typename T,
class Context>
55 beta_(this->
template GetSingleArgument<float>(
"beta", 1.)),
56 scale_(this->
template GetSingleArgument<float>(
"scale", 1.)) {
57 CAFFE_ENFORCE(beta_ > 0);
58 CAFFE_ENFORCE(scale_ >= 0);
60 USE_OPERATOR_CONTEXT_FUNCTIONS;
62 bool RunOnDevice()
override {
64 CAFFE_NOT_IMPLEMENTED;
70 Tensor buff_{Context::GetDeviceType()};
75 #endif // 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 ...