1 #ifndef CAFFE2_OPERATORS_CLIP_OP_H_ 2 #define CAFFE2_OPERATORS_CLIP_OP_H_ 6 #include "caffe2/core/context.h" 7 #include "caffe2/core/logging.h" 8 #include "caffe2/core/operator.h" 9 #include "caffe2/utils/math.h" 13 template <
typename T,
class Context>
16 USE_OPERATOR_CONTEXT_FUNCTIONS;
19 min_(std::numeric_limits<T>::lowest()),
20 max_(std::numeric_limits<T>::max()) {
22 min_ =
static_cast<T
>(OperatorBase::GetSingleArgument<float>(
"min", 0));
25 max_ =
static_cast<T
>(OperatorBase::GetSingleArgument<float>(
"max", 0));
29 bool RunOnDevice()
override;
36 template <
typename T,
class Context>
39 USE_OPERATOR_CONTEXT_FUNCTIONS;
42 min_(std::numeric_limits<T>::lowest()),
43 max_(std::numeric_limits<T>::max()) {
45 min_ =
static_cast<T
>(OperatorBase::GetSingleArgument<float>(
"min", 0));
48 max_ =
static_cast<T
>(OperatorBase::GetSingleArgument<float>(
"max", 0));
52 bool RunOnDevice()
override;
62 #endif // CAFFE2_OPERATORS_CLIP_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 ...
bool HasArgument(const string &name) const
Checks if the operator has an argument of the given name.