From 077aa207e45521e398e845190fbd5e225f7f66f9 Mon Sep 17 00:00:00 2001 From: Xin Pan Date: Mon, 16 Jul 2018 10:40:24 +0800 Subject: [PATCH] hide monkey_patch_variable --- python/paddle/fluid/__init__.py | 4 +++- python/paddle/fluid/layers/__init__.py | 1 - python/paddle/fluid/layers/math_op_patch.py | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/python/paddle/fluid/__init__.py b/python/paddle/fluid/__init__.py index a06e041c1e8..fd901f91a1d 100644 --- a/python/paddle/fluid/__init__.py +++ b/python/paddle/fluid/__init__.py @@ -57,6 +57,8 @@ import recordio_writer import parallel_executor from parallel_executor import * +from paddle.fluid.layers.math_op_patch import monkey_patch_variable + Tensor = LoDTensor __all__ = framework.__all__ + executor.__all__ + concurrency.__all__ + \ @@ -138,5 +140,5 @@ def __bootstrap__(): # TODO(panyx0718): Avoid doing complex initialization logic in __init__.py. # Consider paddle.init(args) or paddle.main(args) -layers.monkey_patch_variable() +monkey_patch_variable() __bootstrap__() diff --git a/python/paddle/fluid/layers/__init__.py b/python/paddle/fluid/layers/__init__.py index cd1492da24d..4917e67de0d 100644 --- a/python/paddle/fluid/layers/__init__.py +++ b/python/paddle/fluid/layers/__init__.py @@ -33,7 +33,6 @@ from metric_op import * from learning_rate_scheduler import * __all__ = [] -__all__ += math_op_patch.__all__ __all__ += nn.__all__ __all__ += io.__all__ __all__ += tensor.__all__ diff --git a/python/paddle/fluid/layers/math_op_patch.py b/python/paddle/fluid/layers/math_op_patch.py index 1754061c4ba..f814c41633f 100644 --- a/python/paddle/fluid/layers/math_op_patch.py +++ b/python/paddle/fluid/layers/math_op_patch.py @@ -16,8 +16,6 @@ from ..framework import Variable, unique_name from layer_function_generator import OpProtoHolder from ..initializer import force_init_on_cpu -__all__ = ['monkey_patch_variable'] - def monkey_patch_variable(): def unique_tmp_name(): -- GitLab