docstr: Tests the ``full_output`` feature of Rotosolve, delivering intermediate cost
  function values at the univariate optimization substeps.
docstr_tok: ["Tests","the","``","full_output","``","feature","of","Rotosolve",",","delivering","intermediate","cost","function","values","at","the","univariate","optimization","substeps","."]
code: def test_full_output(
      self,
      fun,
      x_min,
      param,
      nums_freq,
      exp_num_calls,
      substep_optimizer,
      substep_kwargs,
  ):
      """Tests the ``full_output`` feature of Rotosolve, delivering intermediate cost
      function values at the univariate optimization substeps."""
      param = tuple(np.array(p, requires_grad=True) for p in param)
      opt = RotosolveOptimizer(substep_optimizer, substep_kwargs)
  
      _, y_output_step = opt.step(
          fun,
          *param,
          nums_frequency=nums_freq,
          full_output=True,
      )
      new_param, old_cost, y_output_step_and_cost = opt.step_and_cost(
          fun,
          *param,
          nums_frequency=nums_freq,
          full_output=True,
      )
      # The following accounts for the unpacking functionality for length-1 param
      if len(param) == 1:
          new_param = (new_param,)
      expected_intermediate_x = successive_params(param, new_param)
      expected_y_output = [
          fun(*par) for par in expected_intermediate_x[1:]
      ]
  
      assert np.allclose(y_output_step, expected_y_output)
      assert np.allclose(y_output_step_and_cost, expected_y_output)
      assert np.isclose(old_cost, fun(*expected_intermediate_x[0]))
  
imports: import functools
  import pytest
  from scipy.optimize import shgo
  import pennylane
  from pennylane import numpy
  from pennylane.utils import _flatten, unflatten
  from pennylane.optimize import RotosolveOptimizer
label_desc: Use image node_id 3 for calling the TestWithClassicalFunction obj's underlying member method code with example usage: obj.test_full_output(fun, x_min, param, nums_freq, exp_num_calls, substep_optimizer, substep_kwargs) without return types