1 #ifndef CAFFE2_OPERATORS_LAYER_NORM_OP_H 2 #define CAFFE2_OPERATORS_LAYER_NORM_OP_H 4 #include "caffe2/core/context.h" 5 #include "caffe2/core/operator.h" 6 #include "caffe2/utils/math.h" 10 template <
class Context>
13 USE_OPERATOR_CONTEXT_FUNCTIONS;
16 axis_(OperatorBase::GetSingleArgument<int>(
"axis", 1)),
17 epsilon_(OperatorBase::GetSingleArgument<float>(
"epsilon", 1e-5f)) {}
23 bool RunOnDevice()
override {
24 return DoRunWithType<float>();
35 template <
class Context>
38 USE_OPERATOR_CONTEXT_FUNCTIONS;
41 axis_(OperatorBase::GetSingleArgument<int>(
"axis", 1)),
42 epsilon_(OperatorBase::GetSingleArgument<float>(
"epsilon", 0.001f)) {}
48 bool RunOnDevice()
override {
49 return DoRunWithType<float>();
Tensor is the basic class in Caffe2 that stores a contiguous memory with its shape information...
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 ...