class BatchMatMulOp final : public Operator<Context> {
public:
USE_OPERATOR_CONTEXT_FUNCTIONS;
- BatchMatMulOp(const OperatorDef& operator_def, Workspace* ws)
- : Operator<Context>(operator_def, ws),
+ template <class... Args>
+ explicit BatchMatMulOp(Args&&... args)
+ : Operator<Context>(std::forward<Args>(args)...),
trans_a_(this->template GetSingleArgument<int>("trans_a", 0)),
trans_b_(this->template GetSingleArgument<int>("trans_b", 0)),
broadcast_(this->template GetSingleArgument<int>("broadcast", 0)) {}
public:
USE_OPERATOR_CONTEXT_FUNCTIONS;
- BatchMomentsOp(const OperatorDef& operator_def, Workspace* ws)
- : Operator<Context>(operator_def, ws),
+ template <class... Args>
+ explicit BatchMomentsOp(Args&&... args)
+ : Operator<Context>(std::forward<Args>(args)...),
order_(StringToStorageOrder(
this->template GetSingleArgument<std::string>("order", "NCHW"))) {
CAFFE_ENFORCE_NE(order_, StorageOrder::UNKNOWN);
public:
USE_OPERATOR_CONTEXT_FUNCTIONS;
- BatchMomentsGradientOp(const OperatorDef& operator_def, Workspace* ws)
- : Operator<Context>(operator_def, ws),
+ template <class... Args>
+ explicit BatchMomentsGradientOp(Args&&... args)
+ : Operator<Context>(std::forward<Args>(args)...),
order_(StringToStorageOrder(
this->template GetSingleArgument<std::string>("order", "NCHW"))) {
CAFFE_ENFORCE_NE(order_, StorageOrder::UNKNOWN);
class BatchSparseToDenseOp : public Operator<Context> {
public:
USE_OPERATOR_CONTEXT_FUNCTIONS;
- BatchSparseToDenseOp(const OperatorDef& operator_def, Workspace* ws)
- : Operator<Context>(operator_def, ws),
+ template <class... Args>
+ explicit BatchSparseToDenseOp(Args&&... args)
+ : Operator<Context>(std::forward<Args>(args)...),
OP_SINGLE_ARG(int64_t, "dense_last_dim", dense_last_dim_, -1),
OP_SINGLE_ARG(T, "default_value", default_value_, static_cast<T>(0)) {}
bool RunOnDevice() override;
class BatchDenseToSparseOp : public Operator<Context> {
public:
USE_OPERATOR_CONTEXT_FUNCTIONS;
- BatchDenseToSparseOp(const OperatorDef& operator_def, Workspace* ws)
- : Operator<Context>(operator_def, ws) {}
+ template <class... Args>
+ explicit BatchDenseToSparseOp(Args&&... args)
+ : Operator<Context>(std::forward<Args>(args)...) {}
bool RunOnDevice() override;
private:
class BisectPercentileOp final : public Operator<Context> {
public:
USE_OPERATOR_CONTEXT_FUNCTIONS;
- BisectPercentileOp(const OperatorDef& operator_def, Workspace* ws)
- : Operator<Context>(operator_def, ws),
+ template <class... Args>
+ explicit BisectPercentileOp(Args&&... args)
+ : Operator<Context>(std::forward<Args>(args)...),
pct_raw_(OperatorBase::GetRepeatedArgument<float>(
"percentile_raw",
vector<float>{})),
class BooleanMaskLengthsOp final : public Operator<Context> {
public:
USE_OPERATOR_CONTEXT_FUNCTIONS;
- BooleanMaskLengthsOp(const OperatorDef& operator_def, Workspace* ws)
- : Operator<Context>(operator_def, ws) {}
+ template <class... Args>
+ explicit BooleanMaskLengthsOp(Args&&... args)
+ : Operator<Context>(std::forward<Args>(args)...) {}
bool RunOnDevice() override {
return DispatchHelper<TensorTypes<int32_t, int64_t>>::call(this, Input(0));
class BooleanMaskOp final : public Operator<Context> {
public:
USE_OPERATOR_CONTEXT_FUNCTIONS;
- BooleanMaskOp(const OperatorDef& operator_def, Workspace* ws)
- : Operator<Context>(operator_def, ws) {}
+ template <class... Args>
+ explicit BooleanMaskOp(Args&&... args)
+ : Operator<Context>(std::forward<Args>(args)...) {}
bool RunOnDevice() override;
};