(self, batch_size)
Returns a batch of data and one-hot labels.
Returns a batch of data and one-hot labels.
Returns a batch of data and one - hot labels .
def provide_data(self, batch_size):
    """Returns a batch of data and one-hot labels."""
    with tf.name_scope('inputs'):
      with tf.device('/cpu:0'):
        dataset = self.dataset.provide_dataset()
        dataset = dataset.shuffle(buffer_size=1000)
        dataset = dataset.map(self._map_fn, num_parallel_calls=4)
        dataset = dataset.batch(batch_size)
        dataset = dataset.prefetch(1)

        iterator = tf.data.make_initializable_iterator(dataset)
        tf.add_to_collection(tf.GraphKeys.TABLE_INITIALIZERS,
                             iterator.initializer)

        data, one_hot_labels = iterator.get_next()
        data.set_shape([batch_size, None, None, None])
        one_hot_labels.set_shape([batch_size, None])
        return data, one_hot_labels
def provide_data ( self , batch_size ) : with tf . name_scope ( 'inputs' ) : with tf . device ( '/cpu:0' ) : dataset = self . dataset . provide_dataset ( ) dataset = dataset . shuffle ( buffer_size = 1000 ) dataset = dataset . map ( self . _map_fn , num_parallel_calls = 4 ) dataset = dataset . batch ( batch_size ) dataset = dataset . prefetch ( 1 ) iterator = tf . data . make_initializable_iterator ( dataset ) tf . add_to_collection ( tf . GraphKeys . TABLE_INITIALIZERS , iterator . initializer ) data , one_hot_labels = iterator . get_next ( ) data . set_shape ( [ batch_size , None , None , None ] ) one_hot_labels . set_shape ( [ batch_size , None ] ) return data , one_hot_labels