def __init__(self, dist_fn, name="DistanceLoss"):
    """Creates a new DistanceLoss.

    Args:
      dist_fn: Function that maps a pair of tensors to distances.
      name: String used as the most outer scope name of the loss graph.
    """
    super(DistanceLoss, self).__init__(name=name)
    self._dist_fn = dist_fn
Creates a new DistanceLoss.

    Args:
      dist_fn: Function that maps a pair of tensors to distances.
      name: String used as the most outer scope name of the loss graph.
    
language/labs/consistent_zero_shot_nmt/models/losses.py