Skip to content

Commit f94a0cc

Browse files
authored
Merge pull request PaddlePaddle#922 from reyoung/feature/fix_bugs_in_math
Fix bad import name in trainer_config_helpers.
2 parents d5c7737 + 54cb6bd commit f94a0cc

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

python/paddle/trainer_config_helpers/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
from attrs import *
2323

2424
# This will enable operator overload for LayerOutput
25-
import math
25+
import math as layer_math

python/paddle/trainer_config_helpers/tests/configs/math_ops.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
from paddle.trainer_config_helpers import *
2-
from paddle.trainer_config_helpers import math
32

43
settings(batch_size=1000, learning_rate=1e-5)
54

65
x = data_layer(name='data', size=100)
7-
x = math.exp(x)
8-
x = math.log(x)
9-
x = math.abs(x)
10-
x = math.sigmoid(x)
11-
x = math.square(x)
12-
x = math.square(x)
6+
x = layer_math.exp(x)
7+
x = layer_math.log(x)
8+
x = layer_math.abs(x)
9+
x = layer_math.sigmoid(x)
10+
x = layer_math.square(x)
11+
x = layer_math.square(x)
1312
y = 1 + x
1413
y = y + 1
1514
y = x + y

0 commit comments

Comments
 (0)