Skip to content

Commit 0633095

Browse files
committed
fix_api_kwargs
1 parent 46498bf commit 0633095

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

python/paddle/fluid/layers/ops.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
# e.g.: test_program_code.py, test_dist_train.py
6464
globals()['_scale'] = generate_layer_fn('scale')
6565

66+
globals()['_elementwise_div'] = generate_layer_fn('elementwise_div')
67+
6668
__all__ += __activations_noattr__
6769

6870
for _OP in set(__activations_noattr__):

python/paddle/fluid/optimizer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from .regularizer import append_regularization_ops
2727
from .clip import append_gradient_clip_ops, error_clip_callback
2828
from contextlib import contextmanager
29+
from .layers import ops
2930

3031
__all__ = [
3132
'SGD', 'Momentum', 'Adagrad', 'Adam', 'Adamax', 'DecayedAdagrad', 'Ftrl',
@@ -1301,7 +1302,7 @@ def _add_average_apply_op(self, block, param_grad):
13011302
x=tmp, dtype='float32' if self._dtype == None else self._dtype)
13021303
sum = layers.cast(
13031304
x=sum, dtype='float32' if self._dtype == None else self._dtype)
1304-
layers.elementwise_div(x=sum, y=tmp, out=param)
1305+
ops._elementwise_div(x=sum, y=tmp, out=param)
13051306

13061307
def _add_average_restore_op(self, block, param_grad):
13071308
param = block._clone_variable(param_grad[0])

0 commit comments

Comments
 (0)