"...runtime/git@developer.sourcefind.cn:change/sglang.git" did not exist on "40782f05d7b94e171f39381fa4c606d952568e60"
Unverified Commit 9074c326 authored by Neal Wu's avatar Neal Wu Committed by GitHub
Browse files

Merge pull request #3300 from MarkDaoust/return_dataset

Return dataset from input_fn
parents 90301fb4 9e15020a
...@@ -35,8 +35,8 @@ def train_input_fn(features, labels, batch_size): ...@@ -35,8 +35,8 @@ def train_input_fn(features, labels, batch_size):
# Shuffle, repeat, and batch the examples. # Shuffle, repeat, and batch the examples.
dataset = dataset.shuffle(1000).repeat().batch(batch_size) dataset = dataset.shuffle(1000).repeat().batch(batch_size)
# Return the read end of the pipeline. # Return the dataset.
return dataset.make_one_shot_iterator().get_next() return dataset
def eval_input_fn(features, labels, batch_size): def eval_input_fn(features, labels, batch_size):
...@@ -55,8 +55,8 @@ def eval_input_fn(features, labels, batch_size): ...@@ -55,8 +55,8 @@ def eval_input_fn(features, labels, batch_size):
assert batch_size is not None, "batch_size must not be None" assert batch_size is not None, "batch_size must not be None"
dataset = dataset.batch(batch_size) dataset = dataset.batch(batch_size)
# Return the read end of the pipeline. # Return the dataset.
return dataset.make_one_shot_iterator().get_next() return dataset
# The remainder of this file contains a simple example of a csv parser, # The remainder of this file contains a simple example of a csv parser,
...@@ -89,5 +89,5 @@ def csv_input_fn(csv_path, batch_size): ...@@ -89,5 +89,5 @@ def csv_input_fn(csv_path, batch_size):
# Shuffle, repeat, and batch the examples. # Shuffle, repeat, and batch the examples.
dataset = dataset.shuffle(1000).repeat().batch(batch_size) dataset = dataset.shuffle(1000).repeat().batch(batch_size)
# Return the read end of the pipeline. # Return the dataset.
return dataset.make_one_shot_iterator().get_next() return dataset
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment