class_docstr: Shallow models for knowledge representation learning.
      
docstr: Load embeddings of inputs.
          
code: def prepare_inputs(
      self,
      h_index,
      r_index,
      t_index,
      all_ent_index,
      neg_ent_index=None,
      ent_emb=None,
      rel_emb=None,
      mode="tail",
      args=None,
  ):
      """Load embeddings of inputs."""
      if ent_emb is not None:
          if self._use_feat and self._ent_feat is not None:
              ent_feat = paddle.to_tensor(
                  self._ent_feat[all_ent_index.numpy()].astype(
                      "float32"
                  )
              )
              ent_emb = self.trans_ent(ent_feat, ent_emb)
      else:
          ent_emb = self._get_ent_embedding(all_ent_index)
  
      if rel_emb is not None:
          if self._use_feat and self._rel_feat is not None:
              rel_feat = paddle.to_tensor(
                  self._rel_feat[r_index.numpy()].astype("float32")
              )
              pos_r = self.trans_rel(rel_feat, rel_emb)
      else:
          pos_r = self._get_rel_embedding(r_index)
  
      pos_h = F.embedding(h_index, ent_emb)
      pos_t = F.embedding(t_index, ent_emb)
  
      mask = None
      if neg_ent_index is not None:
          neg_ent_emb = F.embedding(neg_ent_index, ent_emb)
          neg_ent_emb = paddle.reshape(
              neg_ent_emb, (self._num_chunks, -1, self._ent_dim)
          )
          if args.neg_deg_sample:
              if mode == "head":
                  pos_emb = paddle.reshape(
                      pos_h, (self._num_chunks, -1, self._ent_dim)
                  )
              else:
                  pos_emb = paddle.reshape(
                      pos_t, (self._num_chunks, -1, self._ent_dim)
                  )
              chunk_size = pos_emb.shape[1]
              neg_sample_size = neg_ent_emb.shape[1]
              neg_ent_emb = paddle.concat(
                  [pos_emb, neg_ent_emb], axis=1
              )
              mask = paddle.ones(
                  [
                      self._num_chunks,
                      chunk_size * (neg_sample_size + chunk_size),
                  ],
                  dtype="float32",
              )
              neg_sample_size = chunk_size + neg_sample_size
              mask[:, 0 :: (neg_sample_size + 1)] = 0.0
              mask = paddle.reshape(
                  mask, [self._num_chunks, chunk_size, -1]
              )
      else:
          neg_ent_emb = None
  
      return pos_h, pos_r, pos_t, neg_ent_emb, mask
  
imports: import os
  import json
  import math
  import warnings
  import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from pgl.utils.shared_embedding import SharedEmbedding
  from models.score_funcs import TransEScore, RotatEScore, DistMultScore, ComplExScore, QuatEScore, OTEScore
  from models.init_func import InitFunction
  from utils import uniform, timer_wrapper
label_desc: Use image node_id 6 for calling the KGEModel obj's underlying member method code with example usage: obj.prepare_inputs(h_index, r_index, t_index, all_ent_index, neg_ent_index, ent_emb, rel_emb, mode, args) and returns: pos_h,  pos_r,  pos_t,  neg_ent_emb,  mask