(x, y)
return tf.reduce_sum(input_tensor=tf.square(x - y), axis=2)
Computes the Euclidean distance.
Computes the Euclidean distance.
Computes the Euclidean distance .
def euclidean_distance(x, y):
  """Computes the Euclidean distance."""
  x = tf.expand_dims(x, 1)
  y = tf.expand_dims(y, 0)
  return tf.reduce_sum(input_tensor=tf.square(x - y), axis=2)
def euclidean_distance ( x , y ) : x = tf . expand_dims ( x , 1 ) y = tf . expand_dims ( y , 0 ) return tf . reduce_sum ( input_tensor = tf . square ( x - y ) , axis = 2 )