MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _get_next_batch

Function _get_next_batch

tensorflow/python/keras/engine/training_generator.py:360–375  ·  view source on GitHub ↗

Retrieves the next batch of input data.

(generator)

Source from the content-addressed store, hash-verified

358
359
360def _get_next_batch(generator):
361 """Retrieves the next batch of input data."""
362 try:
363 generator_output = next(generator)
364 except (StopIteration, errors.OutOfRangeError):
365 return None
366
367 if not isinstance(generator_output, tuple):
368 # Always wrap in a tuple.
369 generator_output = (generator_output,)
370 if len(generator_output) not in [1, 2, 3]:
371 raise ValueError(
372 'Output of generator should be a tuple of 1 or 2 or 3 '
373 'elements: (input,) or (input, target) or '
374 '(input, target, sample_weights). Received {}'.format(generator_output))
375 return generator_output
376
377
378def _validate_arguments(is_sequence, is_dataset, use_multiprocessing, workers,

Callers 1

model_iterationFunction · 0.85

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected