@@ -19,28 +19,28 @@ namespace operators {
19
19
20
20
template <>
21
21
void GetAccumulators<paddle::platform::CPUDeviceContext>(
22
- const framework::ExecutionContext& ctx, int64_t * num_updates_ ,
23
- int64_t * num_accumulates_ , int64_t * old_num_accumulates_ ) {
22
+ const framework::ExecutionContext& ctx, int64_t * num_updates ,
23
+ int64_t * num_accumulates , int64_t * old_num_accumulates ) {
24
24
auto * in_old_num_accumulates = ctx.Input <Tensor>(" in_old_num_accumulates" );
25
25
auto * in_num_accumulates = ctx.Input <Tensor>(" in_num_accumulates" );
26
26
auto * in_num_updates = ctx.Input <Tensor>(" in_num_updates" );
27
27
28
- *old_num_accumulates_ = in_old_num_accumulates->data <int64_t >()[0 ];
29
- *num_accumulates_ = in_num_accumulates->data <int64_t >()[0 ];
30
- *num_updates_ = in_num_updates->data <int64_t >()[0 ];
28
+ *old_num_accumulates = in_old_num_accumulates->data <int64_t >()[0 ];
29
+ *num_accumulates = in_num_accumulates->data <int64_t >()[0 ];
30
+ *num_updates = in_num_updates->data <int64_t >()[0 ];
31
31
}
32
32
33
33
template <>
34
34
void SetAccumulators<paddle::platform::CPUDeviceContext>(
35
- const framework::ExecutionContext& ctx, int64_t num_updates_ ,
36
- int64_t num_accumulates_ , int64_t old_num_accumulates_ ) {
35
+ const framework::ExecutionContext& ctx, int64_t num_updates ,
36
+ int64_t num_accumulates , int64_t old_num_accumulates ) {
37
37
auto * out_old_num_accumulates = ctx.Output <Tensor>(" out_old_num_accumulates" );
38
38
auto * out_num_accumulates = ctx.Output <Tensor>(" out_num_accumulates" );
39
39
auto * out_num_updates = ctx.Output <Tensor>(" out_num_updates" );
40
40
41
- out_old_num_accumulates->data <int64_t >()[0 ] = old_num_accumulates_ ;
42
- out_num_accumulates->data <int64_t >()[0 ] = num_accumulates_ ;
43
- out_num_updates->data <int64_t >()[0 ] = num_updates_ ;
41
+ out_old_num_accumulates->data <int64_t >()[0 ] = old_num_accumulates ;
42
+ out_num_accumulates->data <int64_t >()[0 ] = num_accumulates ;
43
+ out_num_updates->data <int64_t >()[0 ] = num_updates ;
44
44
}
45
45
46
46
class AverageAccumulatesOp : public framework ::OperatorWithKernel {
@@ -177,7 +177,7 @@ class AverageAccumulatesOpMaker : public framework::OpProtoAndCheckerMaker {
177
177
178
178
AddComment (R"DOC(
179
179
AverageAccumulates Operator.
180
- Accumulate the sum of parameter whtin sliding window. The size of sliding window is
180
+ Accumulate the sum of parameter within sliding window. The size of sliding window is
181
181
determined by 'average_window', 'max_average_window' and 'min_average_window'.
182
182
Memory was shared by Input(in_sum_1) and Output(out_sum_1) which acts as an accumulator 'sum_1'.
183
183
'sum_2', 'sum_3', 'num_accumulates', 'old_num_accumulates' and 'num_updates' were the same as 'sum_1'.
0 commit comments