class BoxWithNMSLimitOp final : public Operator<Context> {
public:
USE_OPERATOR_CONTEXT_FUNCTIONS;
- BoxWithNMSLimitOp(const OperatorDef& operator_def, Workspace* ws)
- : Operator<Context>(operator_def, ws),
+ template <class... Args>
+ explicit BoxWithNMSLimitOp(Args&&... args)
+ : Operator<Context>(std::forward<Args>(args)...),
score_thres_(
this->template GetSingleArgument<float>("score_thresh", 0.05)),
nms_thres_(this->template GetSingleArgument<float>("nms", 0.3)),
public:
USE_OPERATOR_CONTEXT_FUNCTIONS;
- CastOp(const OperatorDef& operator_def, Workspace* ws)
+ explicit CastOp(const OperatorDef& operator_def, Workspace* ws)
: Operator<Context>(operator_def, ws) {
const ArgumentHelper helper(operator_def);
TensorProto_DataType to = cast::GetCastDataType(helper, "to");
class ChannelBackpropStatsOp : public Operator<Context> {
public:
USE_OPERATOR_CONTEXT_FUNCTIONS;
- ChannelBackpropStatsOp(const OperatorDef& operator_def, Workspace* ws)
- : Operator<Context>(operator_def, ws) {}
+ template <class... Args>
+ explicit ChannelBackpropStatsOp(Args&&... args)
+ : Operator<Context>(std::forward<Args>(args)...) {}
~ChannelBackpropStatsOp() {}
bool RunOnDevice() override {
public:
USE_OPERATOR_CONTEXT_FUNCTIONS;
- ChannelShuffleOp(const OperatorDef& operator_def, Workspace* ws)
- : Operator<Context>(operator_def, ws),
+ template <class... Args>
+ explicit ChannelShuffleOp(Args&&... args)
+ : Operator<Context>(std::forward<Args>(args)...),
order_(StringToStorageOrder(
this->template GetSingleArgument<std::string>("order", "NCHW"))),
OP_SINGLE_ARG(int, "group", group_, 1) {
public:
USE_OPERATOR_CONTEXT_FUNCTIONS;
- ChannelShuffleGradientOp(const OperatorDef& operator_def, Workspace* ws)
- : Operator<Context>(operator_def, ws),
+ template <class... Args>
+ explicit ChannelShuffleGradientOp(Args&&... args)
+ : Operator<Context>(std::forward<Args>(args)...),
order_(StringToStorageOrder(
this->template GetSingleArgument<std::string>("order", "NCHW"))),
OP_SINGLE_ARG(int, "group", group_, 1) {
class ChannelStatsOp : public Operator<Context> {
public:
USE_OPERATOR_CONTEXT_FUNCTIONS;
- ChannelStatsOp(const OperatorDef& operator_def, Workspace* ws)
- : Operator<Context>(operator_def, ws) {}
+ template <class... Args>
+ explicit ChannelStatsOp(Args&&... args)
+ : Operator<Context>(std::forward<Args>(args)...) {}
~ChannelStatsOp() {}
bool RunOnDevice() override {