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;
17 ratio_(OperatorBase::GetSingleArgument<float>(
"ratio", 0.5)),
19 OperatorBase::GetSingleArgument<int>(OpSchema::Arg_IsTest, 0)) {
20 CAFFE_ENFORCE_GE(ratio_, 0);
21 CAFFE_ENFORCE_LT(ratio_, 1);
24 bool RunOnDevice()
override;
32 template <
typename T,
class Context>
35 USE_OPERATOR_CONTEXT_FUNCTIONS;
38 ratio_(OperatorBase::GetSingleArgument<float>(
"ratio", 0.5)),
40 OperatorBase::GetSingleArgument<int>(OpSchema::Arg_IsTest, 0)) {
41 CAFFE_ENFORCE_GE(ratio_, 0);
42 CAFFE_ENFORCE_LT(ratio_, 1);
45 bool RunOnDevice()
override;
55 #endif // CAFFE2_OPERATORS_DROPOUT_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 ...