From 1de9edee514e6ddc98e2372384395bfff78d82e0 Mon Sep 17 00:00:00 2001 From: JiayiFeng Date: Tue, 17 Apr 2018 08:20:34 +0000 Subject: [PATCH] Follow comments --- python/paddle/fluid/parallel_executor.py | 5 +++++ .../paddle/fluid/tests/unittests/test_parallel_executor.py | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/python/paddle/fluid/parallel_executor.py b/python/paddle/fluid/parallel_executor.py index 9527a887a..7ad5f0d74 100644 --- a/python/paddle/fluid/parallel_executor.py +++ b/python/paddle/fluid/parallel_executor.py @@ -16,6 +16,7 @@ import core import multiprocessing import framework import executor +import warnings __all__ = ['ParallelExecutor'] @@ -130,6 +131,10 @@ class ParallelExecutor(object): or numpy array. :return: fetched value list. """ + if not feed_dict == {}: + warnings.warn( + "The 'feed_dict' of ParallelExecutor.run() is deprecated. Please use 'feed' instead." + ) if feed == {}: feed = feed_dict if not isinstance(feed, dict): diff --git a/python/paddle/fluid/tests/unittests/test_parallel_executor.py b/python/paddle/fluid/tests/unittests/test_parallel_executor.py index c376810ad..b653f2c11 100644 --- a/python/paddle/fluid/tests/unittests/test_parallel_executor.py +++ b/python/paddle/fluid/tests/unittests/test_parallel_executor.py @@ -223,7 +223,6 @@ class TestParallelExecutorBase(unittest.TestCase): with fluid.program_guard(main, startup): if seed is not None: startup.random_seed = seed - main.random_seed = seed loss = method(use_feed=len(feed_dict) > 0) adam = fluid.optimizer.Adam() adam.minimize(loss) -- GitLab