docstr: Perform the changes that are required when the partition is changed during training.
  
  Parameters
  ----------
  batch_ent_emb:
      Entity embeddings that need to be trained for the partition
      (all triples of the partition will have an embedding in this matrix).
  batch_rel_emb:
      Relation embeddings that need to be trained for the partition
      (all triples of the partition will have an embedding in this matrix).
docstr_tok: ["Perform","the","changes","that","are","required","when","the","partition","is","changed","during","training",".","Parameters","--","--","--","--","--","batch_ent_emb",":","Entity","embeddings","that","need","to","be","trained","for","the","partition","(","all","triples","of","the","partition","will","have","an","embedding","in","this","matrix",")",".","batch_rel_emb",":","Relation","embeddings","that","need","to","be","trained","for","the","partition","(","all","triples","of","the","partition","will","have","an","embedding","in","this","matrix",")","."]
code: def partition_change_updates(
      self, partition_ent_emb, partition_rel_emb
  ):
      """Perform the changes that are required when the partition is changed during training.
  
      Parameters
      ----------
      batch_ent_emb:
          Entity embeddings that need to be trained for the partition
          (all triples of the partition will have an embedding in this matrix).
      batch_rel_emb:
          Relation embeddings that need to be trained for the partition
          (all triples of the partition will have an embedding in this matrix).
  
      """
  
      # if the number of entities in the partition are less than the required size of the embedding matrix
      # pad it. This is needed because the trainable variable size cant change dynamically.
      # Once defined, it stays fixed. Hence padding is needed.
      paddings_ent = tf.constant(
          [
              [
                  0,
                  self._max_ent_size_internal
                  - partition_ent_emb.shape[0],
              ],
              [0, 0],
          ]
      )
      paddings_rel = tf.constant(
          [
              [
                  0,
                  self._max_rel_size_internal
                  - partition_rel_emb.shape[0],
              ],
              [0, 0],
          ]
      )
  
      # once padded, assign it to the trainable variable
      self.ent_emb.assign(
          tf.pad(
              partition_ent_emb,
              paddings_ent,
              "CONSTANT",
              constant_values=0,
          )
      )
      self.rel_emb.assign(
          tf.pad(
              partition_rel_emb,
              paddings_rel,
              "CONSTANT",
              constant_values=0,
          )
      )
  
file_path: AmpliGraph/ampligraph/latent_features/layers/encoding/EmbeddingLookupLayer.py
imports: import tensorflow
  import numpy
label_desc: Use image node_id 11 for calling the EmbeddingLookupLayer obj's underlying member method code with example usage: obj.partition_change_updates(partition_ent_emb, partition_rel_emb) without return types