3 #include "caffe2/core/operator.h" 4 #include "caffe2/utils/math.h" 8 template <
typename T,
class Context>
11 USE_OPERATOR_CONTEXT_FUNCTIONS;
15 OperatorBase::GetSingleArgument<bool>(
"use_max_norm",
true)),
16 norm_(OperatorBase::GetSingleArgument<float>(
"norm", 1.0)) {
17 CAFFE_ENFORCE_GE(norm_, 0,
"norm should be bigger than 0");
20 bool RunOnDevice()
override {
22 Input(PARAM).size_from_dim(1),
23 Input(GRAD).size_from_dim(Input(INDICES).ndim()));
26 this, Input(INDICES));
29 template <
typename SIndex>
35 INPUT_TAGS(PARAM, INDICES, GRAD);
36 OUTPUT_TAGS(OUTPUT_PARAM);
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 ...