1 #ifndef CAFFE2_OPERATORS_LARS_OP_H_ 2 #define CAFFE2_OPERATORS_LARS_OP_H_ 4 #include "caffe2/core/context.h" 5 #include "caffe2/core/logging.h" 6 #include "caffe2/core/operator.h" 10 template <
typename T,
class Context>
13 USE_OPERATOR_CONTEXT_FUNCTIONS;
16 offset_(OperatorBase::GetSingleArgument<float>(
"offset", 0.5)) {}
18 bool RunOnDevice()
override {
22 dX.size() == X.size(),
"Gradient size doesn't match parameter size.");
23 CAFFE_ENFORCE_GE(offset_, 0);
25 auto* lr_rescale = Output(0);
26 lr_rescale->Resize(vector<TIndex>{1});
31 dX.template data<T>(),
33 lr_rescale->template mutable_data<T>());
51 #endif // CAFFE2_OPERATORS_LARS_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 ...