import tensorflow as tf

    logcost = log_quaternion_loss_batch(predictions, labels)
    logcost = tf.reduce_sum(logcost, [0])
    logcost = tf.multiply(logcost, 1.0 / batch_size, name='log_quaternion_loss')
  return logcost
