(session, style_dataset, sample_count)
return generator
Create a generator function that emits style images.

  Args:
    session: tf.Session, the session that contains subgraph to load the traning
      dataset
    style_dataset: tf.data.Dataset that contains training style images.
    sample_count: int, number of sample to create.

  Returns:
    (str, str) A generator function to use as representative dataset for
    TFLiteConverter.
Create a generator function that emits style images.
Create a generator function that emits style images .
def predict_model_gen(session, style_dataset, sample_count):
  """Create a generator function that emits style images.

  Args:
    session: tf.Session, the session that contains subgraph to load the traning
      dataset
    style_dataset: tf.data.Dataset that contains training style images.
    sample_count: int, number of sample to create.

  Returns:
    (str, str) A generator function to use as representative dataset for
    TFLiteConverter.
  """

  def generator():
    dataset = style_dataset.batch(1)
    iterator = tf.data.make_initializable_iterator(dataset)
    session.run(iterator.initializer)
    next_element = iterator.get_next()
    for _ in range(sample_count):
      input_value = session.run(next_element)
      yield [input_value]

  return generator
def predict_model_gen ( session , style_dataset , sample_count ) : def generator ( ) : dataset = style_dataset . batch ( 1 ) iterator = tf . data . make_initializable_iterator ( dataset ) session . run ( iterator . initializer ) next_element = iterator . get_next ( ) for _ in range ( sample_count ) : input_value = session . run ( next_element ) yield [ input_value ] return generator