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;
15 template <
class... Args>
19 bool RunOnDevice()
override;
22 template <
class Context>
25 USE_OPERATOR_CONTEXT_FUNCTIONS;
28 axis_(this->
template GetSingleArgument<int>(
"axis", 1)),
29 radius_(this->
template GetSingleArgument<int>(
"radius", 10)),
30 grad_(this->
template GetSingleArgument<bool>(
"grad",
false)),
31 fill_val_(this->
template GetSingleArgument<float>(
33 -1.0f * std::numeric_limits<float>::infinity())) {
35 mode_ = GetArgument(operator_def,
"mode").s();
38 batch_ = GetArgument(operator_def,
"batch").i();
44 "repeat_from_axis currently only supported in sequence mode.");
47 "repeat_from_axis and batch not currently supported together.");
49 this->
template GetSingleArgument<int>(
"repeat_from_axis", -1);
53 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.