class_docstr: DGL Knowledge Embedding Model.
  
  Parameters
  ----------
  args:
      Global configs.
  model_name : str
      Which KG model to use, including 'TransE_l1', 'TransE_l2', 'TransR',
      'RESCAL', 'DistMult', 'ComplEx', 'RotatE', 'SimplE'
  n_entities : int
      Num of entities.
  n_relations : int
      Num of relations.
  hidden_dim : int
      Dimension size of embedding.
  gamma : float
      Gamma for score function.
  double_entity_emb : bool
      If True, entity embedding size will be 2 * hidden_dim.
      Default: False
  double_relation_emb : bool
      If True, relation embedding size will be 2 * hidden_dim.
      Default: False
docstr: Do the forward and generate ranking results.
  
  Parameters
  ----------
  pos_g : DGLGraph
      Graph holding positive edges.
  neg_g : DGLGraph
      Graph holding negative edges.
  logs : List
      Where to put results in.
  gpu_id : int
      Which gpu to accelerate the calculation. if -1 is provided, cpu is used.
docstr_tok: ["Do","the","forward","and","generate","ranking","results",".","Parameters","--","--","--","--","--","pos_g",":","DGLGraph","Graph","holding","positive","edges",".","neg_g",":","DGLGraph","Graph","holding","negative","edges",".","logs",":","List","Where","to","put","results","in",".","gpu_id",":","int","Which","gpu","to","accelerate","the","calculation",".","if","-1","is","provided",",","cpu","is","used","."]
code: def forward_test_wikikg(self, query, ans, candidate, mode, gpu_id=-1):
      """Do the forward and generate ranking results.
  
      Parameters
      ----------
      pos_g : DGLGraph
          Graph holding positive edges.
      neg_g : DGLGraph
          Graph holding negative edges.
      logs : List
          Where to put results in.
      gpu_id : int
          Which gpu to accelerate the calculation. if -1 is provided, cpu is used.
      """
      scores = self.predict_score_wikikg(
          query,
          candidate,
          mode,
          to_device=cuda,
          gpu_id=gpu_id,
          trace=False,
      )
      argsort = F.argsort(scores, dim=1, descending=True)
      return argsort[:, :10]
  
imports: import os
  import numpy
  import math
  import dgl.backend
  import pdb
  import torch
  import torch.nn
  from .pytorch.tensor_models import logsigmoid
  from .pytorch.tensor_models import abs
  from .pytorch.tensor_models import masked_select
  from .pytorch.tensor_models import get_device, get_dev
  from .pytorch.tensor_models import norm
  from .pytorch.tensor_models import get_scalar
  from .pytorch.tensor_models import reshape
  from .pytorch.tensor_models import cuda
  from .pytorch.tensor_models import ExternalEmbedding
  from .pytorch.tensor_models import InferEmbedding
  from .pytorch.score_fun import *
  from .pytorch.loss import LossGenerator
label_desc: Use image node_id 8 for calling the KEModel obj's underlying member method code with example usage: obj.forward_test_wikikg(query, ans, candidate, mode, gpu_id) and returns: argsort