!421 Fix no need_wrap in ge bankend in mode.train with dataset_sink

Merge pull request !421 from ghzl/fix-no-wrap-in-ge-bankend-in-train
This commit is contained in:
mindspore-ci-bot 2020-04-17 17:02:58 +08:00 committed by Gitee
commit 7036c4ba3d
1 changed files with 4 additions and 2 deletions

View File

@ -254,7 +254,8 @@ class Model:
"""
# remove later to deal with loop sink
need_wrap = False
if not hasattr(train_dataset, '__ME_INITED__') and context.get_context("enable_loop_sink"):
if not hasattr(train_dataset, '__ME_INITED__') and context.get_context("enable_loop_sink") \
and not context.get_context("enable_ge"):
need_wrap = True
dataset_helper = DatasetHelper(train_dataset)
@ -418,7 +419,8 @@ class Model:
# remove later to deal with loop sink
need_wrap = False
if not hasattr(valid_dataset, '__ME_INITED__') and context.get_context("enable_loop_sink"):
if not hasattr(valid_dataset, '__ME_INITED__') and context.get_context("enable_loop_sink") \
and not context.get_context("enable_ge"):
need_wrap = True
valid_dataset.__loop_size__ = 1