1 #include "caffe2/operators/accumulate_op.h" 4 REGISTER_CPU_OPERATOR(Accumulate, AccumulateOp<float, CPUContext>);
6 OPERATOR_SCHEMA(Accumulate)
9 .IdenticalTypeAndShape()
11 Accumulate operator accumulates the input tensor to the output tensor. If the 12 output tensor already has the right size, we add to it; otherwise, we first 13 initialize the output tensor to all zeros, and then do accumulation. Any 14 further calls to the operator, given that no one else fiddles with the output 15 in the interim, will do simple accumulations. 16 Accumulation is done using Axpby operation as shown: 18 where X is the input tensor, Y is the output tensor and gamma is the multiplier 21 .Arg("gamma",
"(float, default 1.0) Accumulation multiplier")
22 .Input(0,
"input",
"The input tensor that has to be accumulated to the " 23 "output tensor. If the output size is not the same as input size, the " 24 "output tensor is first reshaped and initialized to zero, and only " 25 "then, accumulation is done.")
26 .Output(0,
"output",
"Accumulated output tensor");
28 SHOULD_NOT_DO_GRADIENT(Accumulate);
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...