Skip to content

Commit 1de9ede

Browse files
committed
Follow comments
1 parent 93276fd commit 1de9ede

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

python/paddle/fluid/parallel_executor.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import multiprocessing
1717
import framework
1818
import executor
19+
import warnings
1920

2021
__all__ = ['ParallelExecutor']
2122

@@ -130,6 +131,10 @@ def run(self, fetch_list, feed={}, feed_dict={}):
130131
or numpy array.
131132
:return: fetched value list.
132133
"""
134+
if not feed_dict == {}:
135+
warnings.warn(
136+
"The 'feed_dict' of ParallelExecutor.run() is deprecated. Please use 'feed' instead."
137+
)
133138
if feed == {}:
134139
feed = feed_dict
135140
if not isinstance(feed, dict):

python/paddle/fluid/tests/unittests/test_parallel_executor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ def run_executor(exe, feed, fetch_list, program=None):
223223
with fluid.program_guard(main, startup):
224224
if seed is not None:
225225
startup.random_seed = seed
226-
main.random_seed = seed
227226
loss = method(use_feed=len(feed_dict) > 0)
228227
adam = fluid.optimizer.Adam()
229228
adam.minimize(loss)

0 commit comments

Comments
 (0)