'Create a hook-only callback which maintain EMA of the queue size.
Also tf.summary.scalar the EMA.'

def _create_ema_callback(self):

    with self.cached_name_scope():
        size = tf.cast(self.queue.size(), tf.float32, name='queue_size')
    size_ema_op = add_moving_summary(size, collection=None)[0].op
    return RunOp((lambda : size_ema_op), run_before=False, run_as_trigger=False, run_step=True)
