def get_padded_batch(file_list, batch_size, input_size, label_shape=None, num_enqueuing_threads=4, shuffle=False):
    'Reads batches of SequenceExamples from TFRecords and pads them.\n\n  Can deal with variable length SequenceExamples by padding each batch to the\n  length of the longest sequence with zeros.\n\n  Args:\n    file_list: A list of paths to TFRecord files containing SequenceExamples.\n    batch_size: The number of SequenceExamples to include in each batch.\n    input_size: The size of each input vector. The returned batch of inputs\n        will have a shape [batch_size, num_steps, input_size].\n    label_shape: Shape for labels. If not specified, will use [].\n    num_enqueuing_threads: The number of threads to use for enqueuing\n        SequenceExamples.\n    shuffle: Whether to shuffle the batches.\n\n  Returns:\n    inputs: A tensor of shape [batch_size, num_steps, input_size] of floats32s.\n    labels: A tensor of shape [batch_size, num_steps] of int64s.\n    lengths: A tensor of shape [batch_size] of int32s. The lengths of each\n        SequenceExample before padding.\n  Raises:\n    ValueError: If `shuffle` is True and `num_enqueuing_threads` is less than 2.\n  '
    file_queue = tf.train.string_input_producer(file_list)
    reader = tf.TFRecordReader()
    (_, serialized_example) = reader.read(file_queue)
    sequence_features = {'inputs': tf.FixedLenSequenceFeature(shape=[input_size], dtype=tf.float32), 'labels': tf.FixedLenSequenceFeature(shape=(label_shape or []), dtype=tf.int64)}
    (_, sequence) = tf.parse_single_sequence_example(serialized_example, sequence_features=sequence_features)
    length = tf.shape(sequence['inputs'])[0]
    input_tensors = [sequence['inputs'], sequence['labels'], length]
    if shuffle:
        if (num_enqueuing_threads < 2):
            raise ValueError('`num_enqueuing_threads` must be at least 2 when shuffling.')
        shuffle_threads = int((math.ceil(num_enqueuing_threads) / 2.0))
        min_after_dequeue = count_records(file_list, stop_at=SHUFFLE_MIN_AFTER_DEQUEUE)
        input_tensors = _shuffle_inputs(input_tensors, capacity=QUEUE_CAPACITY, min_after_dequeue=min_after_dequeue, num_threads=shuffle_threads)
        num_enqueuing_threads -= shuffle_threads
    tf.logging.info(input_tensors)
    return tf.train.batch(input_tensors, batch_size=batch_size, capacity=QUEUE_CAPACITY, num_threads=num_enqueuing_threads, dynamic_pad=True, allow_smaller_final_batch=False)
Reads batches of SequenceExamples from TFRecords and pads them.

Can deal with variable length SequenceExamples by padding each batch to the
length of the longest sequence with zeros.

Args:
  file_list: A list of paths to TFRecord files containing SequenceExamples.
  batch_size: The number of SequenceExamples to include in each batch.
  input_size: The size of each input vector. The returned batch of inputs
      will have a shape [batch_size, num_steps, input_size].
  label_shape: Shape for labels. If not specified, will use [].
  num_enqueuing_threads: The number of threads to use for enqueuing
      SequenceExamples.
  shuffle: Whether to shuffle the batches.

Returns:
  inputs: A tensor of shape [batch_size, num_steps, input_size] of floats32s.
  labels: A tensor of shape [batch_size, num_steps] of int64s.
  lengths: A tensor of shape [batch_size] of int32s. The lengths of each
      SequenceExample before padding.
Raises:
  ValueError: If `shuffle` is True and `num_enqueuing_threads` is less than 2.
def get_padded_batch(file_list, batch_size, input_size, label_shape=None, num_enqueuing_threads=4, shuffle=False):
    'Reads batches of SequenceExamples from TFRecords and pads them.\n\n  Can deal with variable length SequenceExamples by padding each batch to the\n  length of the longest sequence with zeros.\n\n  Args:\n    file_list: A list of paths to TFRecord files containing SequenceExamples.\n    batch_size: The number of SequenceExamples to include in each batch.\n    input_size: The size of each input vector. The returned batch of inputs\n        will have a shape [batch_size, num_steps, input_size].\n    label_shape: Shape for labels. If not specified, will use [].\n    num_enqueuing_threads: The number of threads to use for enqueuing\n        SequenceExamples.\n    shuffle: Whether to shuffle the batches.\n\n  Returns:\n    inputs: A tensor of shape [batch_size, num_steps, input_size] of floats32s.\n    labels: A tensor of shape [batch_size, num_steps] of int64s.\n    lengths: A tensor of shape [batch_size] of int32s. The lengths of each\n        SequenceExample before padding.\n  Raises:\n    ValueError: If `shuffle` is True and `num_enqueuing_threads` is less than 2.\n  '
    file_queue = tf.train.string_input_producer(file_list)
    reader = tf.TFRecordReader()
    (_, serialized_example) = reader.read(file_queue)
    sequence_features = {'inputs': tf.FixedLenSequenceFeature(shape=[input_size], dtype=tf.float32), 'labels': tf.FixedLenSequenceFeature(shape=(label_shape or []), dtype=tf.int64)}
    (_, sequence) = tf.parse_single_sequence_example(serialized_example, sequence_features=sequence_features)
    length = tf.shape(sequence['inputs'])[0]
    input_tensors = [sequence['inputs'], sequence['labels'], length]
    if shuffle:
        if (num_enqueuing_threads < 2):
            raise ValueError('`num_enqueuing_threads` must be at least 2 when shuffling.')
        shuffle_threads = int((math.ceil(num_enqueuing_threads) / 2.0))
        min_after_dequeue = count_records(file_list, stop_at=SHUFFLE_MIN_AFTER_DEQUEUE)
        input_tensors = _shuffle_inputs(input_tensors, capacity=QUEUE_CAPACITY, min_after_dequeue=min_after_dequeue, num_threads=shuffle_threads)
        num_enqueuing_threads -= shuffle_threads
    tf.logging.info(input_tensors)
    return tf.train.batch(input_tensors, batch_size=batch_size, capacity=QUEUE_CAPACITY, num_threads=num_enqueuing_threads, dynamic_pad=True, allow_smaller_final_batch=False)