code: def _prepare_args_with_initial_simplex(
      objective_function,
      initial_simplex,
      objective_at_initial_simplex,
      batch_evaluate_objective,
  ):
      """Evaluates the objective function at the specified initial simplex."""
      initial_simplex = tf.convert_to_tensor(initial_simplex)
  
      # If d is the dimension of the problem, the number of vertices in the
      # simplex should be d+1. From this, we can infer the number of dimensions
      # as n - 1 where n is the number of vertices specified.
      num_vertices = tf.shape(initial_simplex)[0]
      dim = num_vertices - 1
      num_evaluations = np.int32(0)
  
      if objective_at_initial_simplex is None:
          (
              objective_at_initial_simplex,
              n_evals,
          ) = _evaluate_objective_multiple(
              objective_function,
              initial_simplex,
              batch_evaluate_objective,
          )
          num_evaluations += n_evals
      objective_at_initial_simplex = tf.convert_to_tensor(
          objective_at_initial_simplex
      )
      return (
          dim,
          num_vertices,
          initial_simplex,
          objective_at_initial_simplex,
          num_evaluations,
      )
  
imports: import collections
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensorshape_util
label_desc: Use image node_id 12 for calling a global function with example usage: _prepare_args_with_initial_simplex(objective_function, initial_simplex, objective_at_initial_simplex, batch_evaluate_objective) and returns: dim,  num_vertices,  initial_simplex,  objective_at_initial_simplex,  num_evaluations