class_docstr: Manages the partitioning related controls.
  
  Handles data generation and informs the model about changes in partition.
class_docstr_tok: ["Manages","the","partitioning","related","controls",".","Handles","data","generation","and","informs","the","model","about","changes","in","partition","."]
docstr: Generates the metadata needed for persisting and loading partition embeddings and other parameters.
code: def _generate_partition_params(self):
      """Generates the metadata needed for persisting and loading partition embeddings and other parameters."""
  
      # create entity embeddings and optimizer hyperparams for all entities
  
      # compute each partition size
      update_part_size = int(
          np.ceil(self.num_ents / self.partitioner_k)
      )
      num_optimizer_hyperparams = (
          self._model.optimizer.get_hyperparam_count()
      )
      # for each partition
      for part_num in range(self.partitioner_k):
          with shelve.open(
              self.ent_map_fname, writeback=True
          ) as ent_partition:
              # create the key (entity index) and value (optim params and
              # embs)
              for i in range(
                  update_part_size * part_num,
                  min(update_part_size * (part_num + 1), self.num_ents),
              ):
                  out_dict_key = str(i)
                  opt_param = np.zeros(
                      shape=(
                          1,
                          num_optimizer_hyperparams,
                          self.internal_k,
                      ),
                      dtype=np.float32,
                  )
                  # ent_emb = xavier(self.num_ents, self.internal_k, num_ents_bucket)
                  ent_emb = self._model.encoding_layer.ent_init(
                      shape=(1, self.internal_k), dtype=tf.float32
                  ).numpy()
                  ent_partition.update(
                      {out_dict_key: [opt_param, ent_emb]}
                  )
  
      # create relation embeddings and optimizer hyperparams for all relations
      # relations are not partitioned
      with shelve.open(
          self.rel_map_fname, writeback=True
      ) as rel_partition:
          for i in range(self.num_rels):
              out_dict_key = str(i)
              # TODO change the hardcoding from 3 to actual hyperparam of
              # optim
              opt_param = np.zeros(
                  shape=(1, num_optimizer_hyperparams, self.internal_k),
                  dtype=np.float32,
              )
              # rel_emb = xavier(self.num_rels, self.internal_k, self.num_rels)
              rel_emb = self._model.encoding_layer.rel_init(
                  shape=(1, self.internal_k), dtype=tf.float32
              ).numpy()
              rel_partition.update({out_dict_key: [opt_param, rel_emb]})
  
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 2 for calling the GeneralPartitionDataManager obj's underlying member method code with example usage: obj._generate_partition_params() without return types