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: Writeback relation embeddings in a specific process to global relation embedding.
  Used in multi-process multi-gpu training model.
  
  rank : int
      Process id.
  rel_parts : List of tensor
      List of tensor stroing edge types of each partition.
docstr_tok: ["Writeback","relation","embeddings","in","a","specific","process","to","global","relation","embedding",".","Used","in","multi-process","multi-gpu","training","model",".","rank",":","int","Process","id",".","rel_parts",":","List","of","tensor","List","of","tensor","stroing","edge","types","of","each","partition","."]
code: def writeback_relation(self, rank=0, rel_parts=None):
      """Writeback relation embeddings in a specific process to global relation embedding.
      Used in multi-process multi-gpu training model.
  
      rank : int
          Process id.
      rel_parts : List of tensor
          List of tensor stroing edge types of each partition.
      """
      idx = rel_parts[rank]
      if self.soft_rel_part:
          idx = self.relation_emb.get_noncross_idx(idx)
      self.global_relation_emb.emb[idx] = F.copy_to(
          self.relation_emb.emb, F.cpu()
      )[idx]
      if self.model_name == "TransR":
          self.score_func.writeback_local_emb(idx)
  
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 14 for calling the KEModel obj's underlying member method code with example usage: obj.writeback_relation(rank, rel_parts) without return types