@@ -1180,16 +1180,16 @@ def __init__(self,
1180
1180
self ._add_average_restore_op (block , param_grad )
1181
1181
1182
1182
def _add_average_apply_op (self , block , param_grad ):
1183
- param = block .clone_variable (param_grad [0 ])
1184
- grad = block .clone_variable (param_grad [1 ])
1185
- sum_1 = block .clone_variable (self ._get_accumulator ('sum_1' , param ))
1186
- sum_2 = block .clone_variable (self ._get_accumulator ('sum_2' , param ))
1187
- sum_3 = block .clone_variable (self ._get_accumulator ('sum_3' , param ))
1188
- num_accumulates = block .clone_variable (
1183
+ param = block ._clone_variable (param_grad [0 ])
1184
+ grad = block ._clone_variable (param_grad [1 ])
1185
+ sum_1 = block ._clone_variable (self ._get_accumulator ('sum_1' , param ))
1186
+ sum_2 = block ._clone_variable (self ._get_accumulator ('sum_2' , param ))
1187
+ sum_3 = block ._clone_variable (self ._get_accumulator ('sum_3' , param ))
1188
+ num_accumulates = block ._clone_variable (
1189
1189
self ._get_accumulator ('num_accumulates' , param ))
1190
- old_num_accumulates = block .clone_variable (
1190
+ old_num_accumulates = block ._clone_variable (
1191
1191
self ._get_accumulator ('old_num_accumulates' , param ))
1192
- num_updates = block .clone_variable (
1192
+ num_updates = block ._clone_variable (
1193
1193
self ._get_accumulator ('num_updates' , param ))
1194
1194
# backup param value to grad
1195
1195
layers .assign (input = param , output = grad )
@@ -1203,8 +1203,8 @@ def _add_average_apply_op(self, block, param_grad):
1203
1203
layers .elementwise_div (x = sum , y = tmp , out = param )
1204
1204
1205
1205
def _add_average_restore_op (self , block , param_grad ):
1206
- param = block .clone_variable (param_grad [0 ])
1207
- grad = block .clone_variable (param_grad [1 ])
1206
+ param = block ._clone_variable (param_grad [0 ])
1207
+ grad = block ._clone_variable (param_grad [1 ])
1208
1208
layers .assign (input = grad , output = param )
1209
1209
1210
1210
def _append_average_accumulate_op (self , param ):
0 commit comments