1 #ifndef CAFFE2_OPERATORS_ACCUMULATE_OP_H_ 2 #define CAFFE2_OPERATORS_ACCUMULATE_OP_H_ 4 #include "caffe2/core/context.h" 5 #include "caffe2/core/operator.h" 6 #include "caffe2/utils/math.h" 10 template <
typename T,
class Context>
13 template <
class... Args>
16 gamma_(static_cast<T>(
17 this->
template GetSingleArgument<float>(
"gamma", 1.0))) {}
18 USE_OPERATOR_CONTEXT_FUNCTIONS;
20 bool RunOnDevice()
override {
21 auto& input =
Input(0);
24 auto* output = Output(0, input.sizes(), at::dtype<T>());
25 math::Axpby<T, T, Context>(
28 input.template data<T>(),
30 output->template mutable_data<T>(),
41 #endif // CAFFE2_OPERATORS_ACCUMULATE_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 ...