4 #include "caffe2/core/context.h" 5 #include "caffe2/core/operator.h" 9 template <
typename T,
class Context>
15 width_scale_ =
static_cast<T
>(
16 OperatorBase::GetSingleArgument<float>(
"width_scale", 1));
19 height_scale_ =
static_cast<T
>(
20 OperatorBase::GetSingleArgument<float>(
"height_scale", 1));
22 CAFFE_ENFORCE_GT(width_scale_, 0);
23 CAFFE_ENFORCE_GT(height_scale_, 0);
25 USE_OPERATOR_CONTEXT_FUNCTIONS;
27 bool RunOnDevice()
override;
34 template <
typename T,
class Context>
39 width_scale_ =
static_cast<T
>(
40 OperatorBase::GetSingleArgument<float>(
"width_scale", 1));
41 height_scale_ =
static_cast<T
>(
42 OperatorBase::GetSingleArgument<float>(
"height_scale", 1));
43 CAFFE_ENFORCE_GT(width_scale_, 0);
44 CAFFE_ENFORCE_GT(height_scale_, 0);
46 USE_OPERATOR_CONTEXT_FUNCTIONS;
48 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.