From 54cb6bdb379ef5304bffbce85b6e980c66cca978 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Fri, 16 Dec 2016 13:38:05 +0800 Subject: [PATCH] Fix bad import name in trainer_config_helpers. * math => layer_math * Fix #903 --- python/paddle/trainer_config_helpers/__init__.py | 2 +- .../tests/configs/math_ops.py | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/python/paddle/trainer_config_helpers/__init__.py b/python/paddle/trainer_config_helpers/__init__.py index 3ac1454934..a2335768b9 100644 --- a/python/paddle/trainer_config_helpers/__init__.py +++ b/python/paddle/trainer_config_helpers/__init__.py @@ -22,4 +22,4 @@ from optimizers import * from attrs import * # This will enable operator overload for LayerOutput -import math +import math as layer_math diff --git a/python/paddle/trainer_config_helpers/tests/configs/math_ops.py b/python/paddle/trainer_config_helpers/tests/configs/math_ops.py index c4c6d4020f..3331c10d64 100644 --- a/python/paddle/trainer_config_helpers/tests/configs/math_ops.py +++ b/python/paddle/trainer_config_helpers/tests/configs/math_ops.py @@ -1,15 +1,14 @@ from paddle.trainer_config_helpers import * -from paddle.trainer_config_helpers import math settings(batch_size=1000, learning_rate=1e-5) x = data_layer(name='data', size=100) -x = math.exp(x) -x = math.log(x) -x = math.abs(x) -x = math.sigmoid(x) -x = math.square(x) -x = math.square(x) +x = layer_math.exp(x) +x = layer_math.log(x) +x = layer_math.abs(x) +x = layer_math.sigmoid(x) +x = layer_math.square(x) +x = layer_math.square(x) y = 1 + x y = y + 1 y = x + y -- GitLab