code: def _cross_squared_distance_matrix(
      x: TensorLike, y: TensorLike
  ) -> tf.Tensor:
      """Pairwise squared distance between two (batch) matrices' rows (2nd dim).
  
      Computes the pairwise distances between rows of x and rows of y.
  
      Args:
        x: `[batch_size, n, d]` float `Tensor`.
        y: `[batch_size, m, d]` float `Tensor`.
  
      Returns:
        squared_dists: `[batch_size, n, m]` float `Tensor`, where
        `squared_dists[b,i,j] = ||x[b,i,:] - y[b,j,:]||^2`.
      """
      x_norm_squared = tf.reduce_sum(tf.square(x), 2)
      y_norm_squared = tf.reduce_sum(tf.square(y), 2)
  
      # Expand so that we can broadcast.
      x_norm_squared_tile = tf.expand_dims(x_norm_squared, 2)
      y_norm_squared_tile = tf.expand_dims(y_norm_squared, 1)
  
      x_y_transpose = tf.matmul(x, y, adjoint_b=True)
  
      # squared_dists[b,i,j] = ||x_bi - y_bj||^2 =
      # x_bi'x_bi- 2x_bi'x_bj + x_bj'x_bj
      squared_dists = (
          x_norm_squared_tile - 2 * x_y_transpose + y_norm_squared_tile
      )
  
      return squared_dists
  
file_path: addons/tensorflow_addons/image/interpolate_spline.py
imports: import tensorflow
  from tensorflow_addons.utils.types import FloatTensorLike, TensorLike
label_desc: Use image node_id 1 for calling a global function with example usage: _cross_squared_distance_matrix(x, y) and returns: squared_dists