diff --git a/python/paddle/v2/optimizer.py b/python/paddle/v2/optimizer.py index a3997994069e5b0625dc88bb7313db4160a60c6c..39b99a8b067fc603e61cefb00e1b9fc63423cd81 100644 --- a/python/paddle/v2/optimizer.py +++ b/python/paddle/v2/optimizer.py @@ -1,3 +1,4 @@ +import py_paddle.swig_paddle as swig_api import paddle.trainer_config_helpers.config_parser_utils as config_parser_utils import paddle.trainer_config_helpers.optimizers as v1_optimizers """ @@ -16,7 +17,6 @@ __all__ = [ class Optimizer(object): def __init__(self, **kwargs): - import py_paddle.swig_paddle as swig_api if 'batch_size' in kwargs: del kwargs['batch_size'] # not important for python library. @@ -35,7 +35,6 @@ class Optimizer(object): For each optimizer(SGD, Adam), GradientMachine should enable different buffers. """ - import py_paddle.swig_paddle as swig_api tmp = swig_api.ParameterOptimizer.create(self.__opt_conf__) assert isinstance(tmp, swig_api.ParameterOptimizer) return tmp.getParameterTypes()