code: def l2_distance(labels, preds):
      
      with tf.variable_scope("l2_distance"):
          return tf.norm(preds - labels, ord=2)
docs: Compute the l2_distance.
  
      :param labels: A float tensor of shape [batch_size, ..., X] representing the labels.
      :param preds: A float tensor of shape [batch_size, ..., X] representing the predictions.
      :return: A float tensor of shape [batch_size, ...] representing the l2 distance.