1 #ifndef BOOLEAN_MASK_OPS_H 2 #define BOOLEAN_MASK_OPS_H 4 #include "caffe2/core/context.h" 5 #include "caffe2/core/operator.h" 6 #include "caffe2/core/tensor.h" 7 #include "caffe2/utils/conversions.h" 11 template <
class Context>
14 USE_OPERATOR_CONTEXT_FUNCTIONS;
18 bool RunOnDevice()
override;
21 template <
class Context>
24 USE_OPERATOR_CONTEXT_FUNCTIONS;
27 axis_(OperatorBase::GetSingleArgument<int>(
"axis", 1)),
28 radius_(OperatorBase::GetSingleArgument<int>(
"radius", 10)),
29 grad_(OperatorBase::GetSingleArgument<bool>(
"grad",
false)),
30 fill_val_(OperatorBase::GetSingleArgument<float>(
32 -1.0f * std::numeric_limits<float>::infinity())) {
34 mode_ = GetArgument(operator_def,
"mode").s();
37 batch_ = GetArgument(operator_def,
"batch").i();
43 "repeat_from_axis currently only supported in sequence mode.");
46 "repeat_from_axis and batch not currently supported together.");
48 OperatorBase::GetSingleArgument<int>(
"repeat_from_axis", -1);
52 bool RunOnDevice()
override;
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 ...
bool HasArgument(const string &name) const
Checks if the operator has an argument of the given name.