'Dequeues a batch of tensor_dict from the BatchQueue.
TODO: use allow_smaller_final_batch to allow running over the whole eval set
Returns:
A list of tensor_dicts of the requested batch_size.'

def dequeue(self):

    batched_tensors = self._queue.dequeue()
    tensors = {}
    shapes = {}
    for (key, batched_tensor) in batched_tensors.items():
        unbatched_tensor_list = tf.unstack(batched_tensor)
        for (i, unbatched_tensor) in enumerate(unbatched_tensor_list):
            if (rt_shape_str in key):
                shapes[(key[:(- len(rt_shape_str))], i)] = unbatched_tensor
            else:
                tensors[(key, i)] = unbatched_tensor
    tensor_dict_list = []
    batch_size = self._batch_size
    for batch_id in range(batch_size):
        tensor_dict = {}
        for key in self._static_shapes:
            tensor_dict[key] = tf.slice(tensors[(key, batch_id)], tf.zeros_like(shapes[(key, batch_id)]), shapes[(key, batch_id)])
            tensor_dict[key].set_shape(self._static_shapes[key])
        tensor_dict_list.append(tensor_dict)
    return tensor_dict_list
