class_docstr: Manages the partitioning related controls.
  
  Handles data generation and informs model about changes in partition.
class_docstr_tok: ["Manages","the","partitioning","related","controls",".","Handles","data","generation","and","informs","model","about","changes","in","partition","."]
docstr: Persists the embeddings and other parameters after a partition is trained.
  
  Parameters
  ----------
  graph_data_loader : GraphDataLoader
      Data loader of the current partition that was trained.
  partition_number: int
      Partition number of the current partition that was trained.
code: def _update_partion_embeddings(
      self, graph_data_loader, partition_number
  ):
      """Persists the embeddings and other parameters after a partition is trained.
  
      Parameters
      ----------
      graph_data_loader : GraphDataLoader
          Data loader of the current partition that was trained.
      partition_number: int
          Partition number of the current partition that was trained.
      """
      # set the trained params back for persisting (exclude paddings)
      self.all_ent_embs[
          self.ent_original_ids
      ] = self._model.encoding_layer.ent_emb.numpy()[
          : len(self.ent_original_ids), :
      ]
      self.all_rel_embs[
          self.rel_original_ids
      ] = self._model.encoding_layer.rel_emb.numpy()[
          : len(self.rel_original_ids), :
      ]
  
      # get the optimizer params related to the embeddings
      (
          ent_opt_hyperparams,
          rel_opt_hyperparams,
      ) = self._model.optimizer.get_entity_relation_hyperparams()
  
      # get the number of params that are created by the optimizer
      num_opt_hyperparams = self._model.optimizer.get_hyperparam_count()
  
      # depending on optimizer, you can have 0 or more params
      if num_opt_hyperparams > 0:
          # store the params
          original_ent_hyperparams = []
          original_rel_hyperparams = []
  
          # get all the different params related to entities and relations
          # eg: beta1, beta2 related to embeddings (when using adam)
          for i in range(num_opt_hyperparams):
              original_ent_hyperparams.append(
                  ent_opt_hyperparams[i][: len(self.ent_original_ids)]
              )
              original_rel_hyperparams.append(
                  rel_opt_hyperparams[i][: len(self.rel_original_ids)]
              )
  
          # store for persistance
          self.all_rel_opt_params[
              self.rel_original_ids, :, :
          ] = np.stack(original_rel_hyperparams, 1)
          self.all_ent_opt_params[
              self.ent_original_ids, :, :
          ] = np.stack(original_ent_hyperparams, 1)
  
      # Open the buckets related to the partition and concat
      splits = graph_data_loader.backend.mapper.metadata["name"].split(
          "-"
      )
      source_bucket = splits[0][-1]
      dest_bucket = splits[1]
  
      try:
          # persist entity related embs and optim params
          s = shelve.open(self.ent_map_fname, writeback=True)
  
          # split and save self.all_ent_opt_params and self.all_ent_embs into
          # respective buckets
          opt_params = [
              self.all_ent_opt_params[: self.split_opt_idx],
              self.all_ent_opt_params[self.split_opt_idx :],
          ]
          emb_params = [
              self.all_ent_embs[: self.split_emb_idx],
              self.all_ent_embs[self.split_emb_idx :],
          ]
  
          s[source_bucket] = [opt_params[0], emb_params[0]]
          s[dest_bucket] = [opt_params[1], emb_params[1]]
  
      finally:
          s.close()
  
      try:
          # persist relation related embs and optim params
          s = shelve.open(self.rel_map_fname, writeback=True)
          s["0"] = [self.all_rel_opt_params, self.all_rel_embs]
  
      finally:
          s.close()
  
imports: import abc
  import glob
  import logging
  import os
  import shelve
  import shutil
  import tempfile
  from datetime import datetime
  import numpy
  import tensorflow
  from .graph_partitioner import PARTITION_ALGO_REGISTRY, AbstractGraphPartitioner
label_desc: Use image node_id 3 for calling the BucketPartitionDataManager obj's underlying member method code with example usage: obj._update_partion_embeddings(graph_data_loader, partition_number) without return types