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
code: def predict_score_wikikg(
      self,
      query,
      candidate,
      mode,
      to_device=None,
      gpu_id=-1,
      trace=False,
  ):
      num_chunks = len(query)
      chunk_size = 1
      neg_sample_size = candidate.shape[1]
      if mode == "h,r->t":
          if self.encoder_model_name == "roberta":
              neg_tail = self.transform_net.embed_entity(
                  self.entity_feat(candidate.view(-1), gpu_id, False)
              )
              head = self.transform_net.embed_entity(
                  self.entity_feat(query[:, 0], gpu_id, False)
              )
              rel = self.transform_net.embed_relation(
                  self.relation_feat(query[:, 1], gpu_id, False)
              )
          elif self.encoder_model_name == "shallow":
              neg_tail = self.entity_emb(
                  candidate.view(-1), gpu_id, False
              )
              head = self.entity_emb(query[:, 0], gpu_id, False)
              rel = self.relation_emb(query[:, 1], gpu_id, False)
          elif self.encoder_model_name == "concat":
              neg_tail = self.transform_net.embed_entity(
                  torch.cat(
                      [
                          self.entity_feat(
                              candidate.view(-1), gpu_id, False
                          ),
                          self.entity_emb(
                              candidate.view(-1), gpu_id, False
                          ),
                      ],
                      -1,
                  )
              )
              head = self.transform_net.embed_entity(
                  torch.cat(
                      [
                          self.entity_feat(query[:, 0], gpu_id, False),
                          self.entity_emb(query[:, 0], gpu_id, False),
                      ],
                      -1,
                  )
              )
              rel = self.transform_net.embed_relation(
                  torch.cat(
                      [
                          self.relation_feat(
                              query[:, 1], gpu_id, False
                          ),
                          self.relation_emb(query[:, 1], gpu_id, False),
                      ],
                      -1,
                  )
              )
          neg_score = self.tail_neg_score(
              head,
              rel,
              neg_tail,
              num_chunks,
              chunk_size,
              neg_sample_size,
          )
      else:
          assert False
      return neg_score.squeeze(dim=1)
  
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 9 for calling the KEModel obj's underlying member method code with example usage: obj.predict_score_wikikg(query, candidate, mode, to_device, gpu_id, trace) and returns: neg_score