class_docstr: The TransE Model.
docstr: Construct test program
docstr_tok: ["Construct","test","program"]
code: def construct_test_program(self):
      """
      Construct test program
      """
      (
          entity_embedding,
          relation_embedding,
      ) = self.creat_share_variables()
      entity_embedding = fluid.layers.l2_normalize(
          entity_embedding, axis=-1
      )
      relation_embedding = fluid.layers.l2_normalize(
          relation_embedding, axis=-1
      )
      head_vec = lookup_table(self.test_input[0], entity_embedding)
      rel_vec = lookup_table(self.test_input[1], relation_embedding)
      tail_vec = lookup_table(self.test_input[2], entity_embedding)
      # The paddle fluid.layers.topk GPU OP is very inefficient
      # we do sort operation in the evaluation step using multiprocessing.
      id_replace_head = fluid.layers.reduce_sum(
          fluid.layers.abs(entity_embedding + rel_vec - tail_vec), dim=1
      )
      id_replace_tail = fluid.layers.reduce_sum(
          fluid.layers.abs(entity_embedding - rel_vec - head_vec), dim=1
      )
  
      return [id_replace_head, id_replace_tail]
  
file_path: PGL/legacy/examples/pgl-ke/model/TransE.py
imports: import paddle.fluid
  from .Model import Model
  from .utils import lookup_table
label_desc: Use image node_id 5 for calling the TransE obj's underlying member method code with example usage: obj.construct_test_program() and returns: list