1 #ifndef CAFFE2_OPERATORS_DROPOUT_OP_H_ 2 #define CAFFE2_OPERATORS_DROPOUT_OP_H_ 4 #include "caffe2/core/context.h" 5 #include "caffe2/core/logging.h" 6 #include "caffe2/core/operator.h" 7 #include "caffe2/utils/math.h" 11 template <
typename T,
class Context>
14 USE_OPERATOR_CONTEXT_FUNCTIONS;
15 template <
class... Args>
18 ratio_(this->
template GetSingleArgument<float>(
"ratio", 0.5)),
20 this->
template GetSingleArgument<int>(OpSchema::Arg_IsTest, 0)) {
21 CAFFE_ENFORCE_GE(ratio_, 0);
22 CAFFE_ENFORCE_LT(ratio_, 1);
25 bool RunOnDevice()
override;
33 template <
typename T,
class Context>
36 USE_OPERATOR_CONTEXT_FUNCTIONS;
37 template <
class... Args>
40 ratio_(this->
template GetSingleArgument<float>(
"ratio", 0.5)),
42 this->
template GetSingleArgument<int>(OpSchema::Arg_IsTest, 0)) {
43 CAFFE_ENFORCE_GE(ratio_, 0);
44 CAFFE_ENFORCE_LT(ratio_, 1);
47 bool RunOnDevice()
override;
57 #endif // CAFFE2_OPERATORS_DROPOUT_OP_H_
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...