class_docstr: Class to handle problems with one single objective function.
  
  param func: objective function.
  param batch_size: size of the batches (default, 1)
  param num_cores: number of cores to use in the process of evaluating the objective (default, 1).
  param objective_name: name of the objective function.
  param batch_type: Type of batch used. Only 'synchronous' evaluations are possible at the moment.
  param space: Not in use.
  
  .. Note:: the objective function should take 2-dimensional numpy arrays as input and outputs. Each row should
  contain a location (in the case of the inputs) or a function evaluation (in the case of the outputs).
class_docstr_tok: ["Class","to","handle","problems","with","one","single","objective","function",".","param","func",":","objective","function",".","param","batch_size",":","size","of","the","batches","(","default",",","1",")","param","num_cores",":","number","of","cores","to","use","in","the","process","of","evaluating","the","objective","(","default",",","1",")",".","param","objective_name",":","name","of","the","objective","function",".","param","batch_type",":","Type","of","batch","used",".","Only","'synchronous","'","evaluations","are","possible","at","the","moment",".","param","space",":","Not","in","use",".","..","Note",":",":","the","objective","function","should","take","2-dimensional","numpy","arrays","as","input","and","outputs",".","Each","row","should","contain","a","location","(","in","the","case","of","the","inputs",")","or","a","function","evaluation","(","in","the","case","of","the","outputs",")","."]
docstr: Evaluates the function a x, where x can be a single location or a batch. The evaluation is performed in parallel
  according to the number of accessible cores.
docstr_tok: ["Evaluates","the","function","a","x",",","where","x","can","be","a","single","location","or","a","batch",".","The","evaluation","is","performed","in","parallel","according","to","the","number","of","accessible","cores","."]
code: def _syncronous_batch_evaluation(self, x):
      """
      Evaluates the function a x, where x can be a single location or a batch. The evaluation is performed in parallel
      according to the number of accessible cores.
      """
      from multiprocessing import Process, Pipe
  
      # --- parallel evaluation of the function
      divided_samples = [
          x[i :: self.n_procs] for i in range(self.n_procs)
      ]
      pipe = [Pipe() for i in range(self.n_procs)]
      proc = [
          Process(target=spawn(self._eval_func), args=(c, k))
          for k, (p, c) in zip(divided_samples, pipe)
      ]
      [p.start() for p in proc]
      [p.join() for p in proc]
  
      # --- time of evaluation is set to constant (=1). This is one of the hypothesis of synchronous batch methods.
      f_evals = np.zeros((x.shape[0], 1))
      cost_evals = np.ones((x.shape[0], 1))
      i = 0
      for p, c in pipe:
          f_evals[i :: self.n_procs] = p.recv()[0]  # throw away costs
          i += 1
      return f_evals, cost_evals
  
file_path: GPyOpt/GPyOpt/core/task/objective.py
imports: import time
  import numpy
  from ...util.general import spawn
  from ...util.general import get_d_moments
  import GPy
  import GPyOpt
label_desc: Use image node_id 4 for calling the SingleObjective obj's underlying member method code with example usage: obj._syncronous_batch_evaluation(x) and returns: f_evals,  cost_evals