code: def _grads(self, x):
          
          try:
              # self._set_params_transformed(x)
              self.optimizer_array = x
              self.obj_grads = self._transform_gradients(self.objective_function_gradients())
              self._fail_count = 0
          except (LinAlgError, ZeroDivisionError, ValueError): #pragma: no cover
              if self._fail_count >= self._allowed_failures:
                  raise
              self._fail_count += 1
              self.obj_grads = np.clip(self._transform_gradients(self.objective_function_gradients()), -1e100, 1e100)
          return self.obj_grads
docs: Gets the gradients from the likelihood and the priors.
  
          Failures are handled robustly. The algorithm will try several times to
          return the gradients, and will raise the original exception if
          the objective cannot be computed.
  
          :param x: the parameters of the model.
          :type x: np.array