1 #ifndef CAFFE_OPERATORS_MOD_OP_H_ 2 #define CAFFE_OPERATORS_MOD_OP_H_ 4 #include "caffe2/core/context.h" 5 #include "caffe2/core/logging.h" 6 #include "caffe2/core/operator.h" 10 template <
class Context>
13 USE_OPERATOR_CONTEXT_FUNCTIONS;
14 template <
class... Args>
15 explicit ModOp(Args&&... args)
17 divisor_ = this->
template GetSingleArgument<int64_t>(
"divisor", 0);
18 CAFFE_ENFORCE_NE(divisor_, 0,
"divisor must not be 0");
19 sign_follow_divisor_ =
20 this->
template GetSingleArgument<bool>(
"sign_follow_divisor",
false);
23 bool RunOnDevice()
override {
35 bool sign_follow_divisor_;
40 #endif // CAFFE_OPERATORS_MOD_OP_H_
const Tensor & Input(int idx, DeviceType type=Context::GetDeviceType())
Retrieve a non-owning reference to the input at position 'idx' for this operator. ...
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...