docstr: Looks up the embeddings of entities and relations of the triples.
  
  Parameters
  ----------
  sample : ndarray, shape (n, 3) or list
      Batch of input triples if a ndarray of shape (n,3) is given or a list
      (of lists) of entities or relations or distances as specified in ``type_of``.
  type_of : str
      Specifies whether we get in input triples or entities or relations.
      Possible values are `"t"` for triples, `"e"` for entities, `"r"`
      for relations and "d" for distances (useful in Nodepiece) (default: `"t"`).
  
  
  Returns
  -------
  emb_triples : list
      List of embeddings of subjects, predicates, objects if ``type_of="t"``
      or a list of embeddings of entities (relations/distance) if ``type_of="e"``
      (``type_of="r"``/``type_of="d"``).
docstr_tok: ["Looks","up","the","embeddings","of","entities","and","relations","of","the","triples",".","Parameters","--","--","--","--","--","sample",":","ndarray",",","shape","(","n",",","3",")","or","list","Batch","of","input","triples","if","a","ndarray","of","shape","(","n,3",")","is","given","or","a","list","(","of","lists",")","of","entities","or","relations","or","distances","as","specified","in","``","type_of","``",".","type_of",":","str","Specifies","whether","we","get","in","input","triples","or","entities","or","relations",".","Possible","values","are","`","``","t","''","`","for","triples",",","`","``","e","''","`","for","entities",",","`","``","r","''","`","for","relations","and","``","d","''","for","distances","(","useful","in","Nodepiece",")","(","default",":","`","``","t","''","`",")",".","Returns","--","--","--","-","emb_triples",":","list","List","of","embeddings","of","subjects",",","predicates",",","objects","if","``","type_of=","''","t","''","``","or","a","list","of","embeddings","of","entities","(","relations\/distance",")","if","``","type_of=","''","e","''","``","(","``","type_of=","''","r","''","``","\/","``","type_of=","''","d","''","``",")","."]
code: def call(self, sample, type_of="t"):
      """
      Looks up the embeddings of entities and relations of the triples.
  
      Parameters
      ----------
      sample : ndarray, shape (n, 3) or list
          Batch of input triples if a ndarray of shape (n,3) is given or a list
          (of lists) of entities or relations or distances as specified in ``type_of``.
      type_of : str
          Specifies whether we get in input triples or entities or relations.
          Possible values are `"t"` for triples, `"e"` for entities, `"r"`
          for relations and "d" for distances (useful in Nodepiece) (default: `"t"`).
  
  
      Returns
      -------
      emb_triples : list
          List of embeddings of subjects, predicates, objects if ``type_of="t"``
          or a list of embeddings of entities (relations/distance) if ``type_of="e"``
          (``type_of="r"``/``type_of="d"``).
      """
      assert type_of in [
          "t",
          "e",
          "r",
          "d",
      ], 'Wrong selection! type_of must be in ["t", "e", "r", "d"]'
      if type_of == "t" or type_of == "triples":
          # look up in the respective embedding matrix
          e_s = tf.nn.embedding_lookup(self.ent_emb, sample[:, 0])
          e_p = tf.nn.embedding_lookup(self.rel_emb, sample[:, 1])
          e_o = tf.nn.embedding_lookup(self.ent_emb, sample[:, 2])
          return [e_s, e_p, e_o]
      elif type_of == "e":
          e = tf.nn.embedding_lookup(self.ent_emb, sample)
      elif type_of == "r":
          e = tf.nn.embedding_lookup(self.rel_emb, sample)
      elif type_of == "d":
          e = tf.nn.embedding_lookup(self.dist_emb, sample)
      return e
  
file_path: AmpliGraph/ampligraph/latent_features/layers/encoding/EmbeddingLookupLayer.py
imports: import tensorflow
  import numpy
label_desc: Use image node_id 12 for calling the EmbeddingLookupLayer obj's underlying member method code with example usage: obj.call(sample, type_of) and returns: e, list