class_docstr: Translating embeddings for modeling multi-relational data.
  https://www.utc.fr/~bordesan/dokuwiki/_media/en/transe_nips13.pdf
class_docstr_tok: ["Translating","embeddings","for","modeling","multi-relational","data",".","https",":","\/\/www.utc.fr\/~bordesan\/dokuwiki\/_media\/en\/transe_nips13.pdf"]
docstr: Euclidean distance.
          
docstr_tok: ["Euclidean","distance","."]
code: def cdist(self, a, b):
      """Euclidean distance."""
      a_s = paddle.norm(a, p=2, axis=-1).pow(2)
      b_s = paddle.norm(b, p=2, axis=-1).pow(2)
      dist_score = -2 * paddle.bmm(a, b.transpose([0, 2, 1]))
      dist_score = dist_score + b_s.unsqueeze(-2) + a_s.unsqueeze(-1)
      dist_score = paddle.sqrt(paddle.clip(dist_score, min=1e-30))
      return dist_score
  
imports: import math
  import numpy
  from numpy.random import RandomState
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn.functional import log_sigmoid
label_desc: Use image node_id 4 for calling the TransEScore obj's underlying member method code with example usage: obj.cdist(a, b) and returns: dist_score