import tensorflow as tf


    domain_predictions = tf.sigmoid(logits)

  domain_loss = tf.losses.log_loss(domain_selection_mask, domain_predictions, weights=weight)

  domain_accuracy = util.accuracy_tf(domain_selection_mask, tf.round(domain_predictions))

  assert_op = tf.Assert(tf.is_finite(domain_loss), [domain_loss])
  with tf.control_dependencies([assert_op]):
    tag_loss = 'losses/domain_loss'
