code: def hyp_distance(x, y, c, eval_mode=False):
      """Hyperbolic distance on the Poincare ball.
  
      Args:
        x: Tensor of size B1 x d
        y: Tensor of size B2 x d
        c: Tensor of size 1 representing the absolute hyperbolic curvature.
        eval_mode: boolean indicating whether to compute all pairwise distances or
          not. If eval_mode=False, must have B1=B2.
  
      Returns:
        Tensor of size B1 x B2 if eval_mode=True, otherwise Tensor of size B1 x 1.
      """
      sqrt_c = tf.sqrt(c)
      x2 = tf.reduce_sum(x * x, axis=-1, keepdims=True)
      if eval_mode:
          y2 = tf.transpose(
              tf.reduce_sum(y * y, axis=-1, keepdims=True)
          )
          xy = tf.matmul(x, y, transpose_b=True)
      else:
          y2 = tf.reduce_sum(y * y, axis=-1, keepdims=True)
          xy = tf.reduce_sum(x * y, axis=-1, keepdims=True)
      c1 = 1 - 2 * c * xy + c * y2
      c2 = 1 - c * x2
      num = tf.sqrt(
          tf.square(c1) * x2 + tf.square(c2) * y2 - (2 * c1 * c2) * xy
      )
      denom = 1 - 2 * c * xy + tf.square(c) * x2 * y2
      pairwise_norm = num / tf.maximum(denom, MIN_NORM)
      dist = artanh(sqrt_c * pairwise_norm)
      return 2 * dist / sqrt_c
  
file_path: neural-structured-learning/research/kg_hyp_emb/utils/hyperbolic.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
label_desc: Use image node_id 7 for calling a global function with example usage: hyp_distance(x, y, c, eval_mode) and returns: unknown