import tensorflow as tf

    weight: the weight of the loss.
    scope: optional name scope for summary tags.

  Returns:
    a scalar tensor representing the correlation loss value.
  """
  with tf.variable_scope(name):
    batch_size = tf.shape(source_samples)[0]
    samples = tf.concat(values=[source_samples, target_samples], axis=0)
    samples = flatten(samples)

    domain_selection_mask = tf.concat(
        values=[tf.zeros((batch_size, 1)), tf.ones((batch_size, 1))], axis=0)

