19 #include "caffe2/core/context.h" 20 #include "caffe2/core/operator.h" 24 template <
typename T,
class Context>
27 template <
class... Args>
33 width_scale_ =
static_cast<T>(
34 this->
template GetSingleArgument<float>(
"width_scale", 1));
37 height_scale_ =
static_cast<T>(
38 this->
template GetSingleArgument<float>(
"height_scale", 1));
40 CAFFE_ENFORCE_GT(width_scale_, 0);
41 CAFFE_ENFORCE_GT(height_scale_, 0);
43 USE_OPERATOR_CONTEXT_FUNCTIONS;
45 bool RunOnDevice()
override;
52 template <
typename T,
class Context>
55 template <
class... Args>
60 width_scale_ =
static_cast<T>(
61 this->
template GetSingleArgument<float>(
"width_scale", 1));
62 height_scale_ =
static_cast<T>(
63 this->
template GetSingleArgument<float>(
"height_scale", 1));
64 CAFFE_ENFORCE_GT(width_scale_, 0);
65 CAFFE_ENFORCE_GT(height_scale_, 0);
67 USE_OPERATOR_CONTEXT_FUNCTIONS;
69 bool RunOnDevice()
override;
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.