Skip to content

Commit

Permalink
update_feed
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqiu committed Nov 17, 2021
1 parent df9c97e commit 6e0241f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion python/paddle/fluid/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,6 @@ def run(self, feed_names, fetch_list, return_numpy=True):
(the Tensor specified in the fetch list) to numpy.ndarray. if it is False,
the type of the return value is a list of :code:`LoDTensor`. The default is True.
"""
# feed = self._update_feed(feed)
fetch_list = self._check_fetch(fetch_list)

tensors = self._new_exe.run(feed_names, fetch_list)._move_to_list()
Expand Down Expand Up @@ -1326,6 +1325,14 @@ def _run_impl(self, program, feed, fetch_list, feed_var_name,
if not inner_program_._is_start_up_program_:
if feed is None:
feed = {}
elif isinstance(feed, (list, tuple)):
assert len(feed) == 1, "Not compiled with data parallel"
feed = feed[0]
if not isinstance(feed, dict):
raise TypeError(
"feed requires dict as its Parameter. But you passed in %s"
% (type(feed)))
feed = self._update_feed(program, feed)
program = self._add_feed_fetch_ops(
program=inner_program_,
feed=feed,
Expand Down

0 comments on commit 6e0241f

Please sign in to comment.