class_docstr: Manages distributed hyperparameter optimisation across many gpus.
class_docstr_tok: ["Manages","distributed","hyperparameter","optimisation","across","many","gpus","."]
docstr: Updates parameter combinations with the index of the worker used.
  
  Args:
    df: DataFrame of parameter combinations.
  
  Returns:
    Updated DataFrame with worker number.
docstr_tok: ["Updates","parameter","combinations","with","the","index","of","the","worker","used",".","Args",":","df",":","DataFrame","of","parameter","combinations",".","Returns",":","Updated","DataFrame","with","worker","number","."]
code: def assign_worker_numbers(self, df):
      """Updates parameter combinations with the index of the worker used.
  
      Args:
        df: DataFrame of parameter combinations.
  
      Returns:
        Updated DataFrame with worker number.
      """
      output = df.copy()
  
      n = self.total_search_iterations
      batch_size = self.num_iterations_per_worker
  
      max_worker_num = int(np.ceil(n / batch_size))
  
      worker_idx = np.concatenate(
          [
              np.tile(i + 1, self.num_iterations_per_worker)
              for i in range(max_worker_num)
          ]
      )
  
      output["worker"] = worker_idx[: len(output)]
  
      return output
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import os
  import shutil
  import libs.utils
  import numpy
  import pandas
label_desc: Use image node_id 10 for calling the DistributedHyperparamOptManager obj's underlying member method code with example usage: obj.assign_worker_numbers(df) and returns: output