code: def calculate_scores(self, src_emb, rel_emb, dst_emb):
      M = tf.matrix_diag(rel_emb)
      scores = tf.einsum("aijk,aik->aij", M, dst_emb)
      scores = tf.reduce_sum(src_emb * scores, axis=-1, keep_dims=True)
  
      return scores
  
file_path: euler/examples/distmult/distmult.py
imports: import tensorflow
  import tf_euler
  import collections
label_desc: Use image node_id 5 for calling the DistMult obj's underlying member method code with example usage: obj.calculate_scores(src_emb, rel_emb, dst_emb) and returns: scores