class_docstr: Test the Gradient Descent optimizer
class_docstr_tok: ["Test","the","Gradient","Descent","optimizer"]
docstr: Test that the correct cost is returned via the step_and_cost method for the
  gradient-descent optimizer
docstr_tok: ["Test","that","the","correct","cost","is","returned","via","the","step_and_cost","method","for","the","gradient-descent","optimizer"]
code: def test_step_and_cost_autograd_sgd_multiple_inputs(self):
      """Test that the correct cost is returned via the step_and_cost method for the
      gradient-descent optimizer"""
      stepsize = 0.1
      sgd_opt = GradientDescentOptimizer(stepsize)
  
      @qml.qnode(qml.device("default.qubit", wires=1))
      def quant_fun(*variables):
          qml.RX(variables[0][1], wires=[0])
          qml.RY(variables[1][2], wires=[0])
          qml.RY(variables[2], wires=[0])
          return qml.expval(qml.PauliZ(0))
  
      inputs = [
          np.array((0.2, 0.3), requires_grad=True),
          np.array([0.4, 0.2, 0.4], requires_grad=False),
          np.array(0.1, requires_grad=True),
      ]
  
      _, res = sgd_opt.step_and_cost(quant_fun, *inputs)
      expected = quant_fun(*inputs)
  
      assert np.all(res == expected)
  
file_path: pennylane/tests/optimize/test_gradient_descent.py
imports: import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.optimize import GradientDescentOptimizer
label_desc: Use image node_id 3 for calling the TestGradientDescentOptimizer obj's underlying member method code with example usage: obj.test_step_and_cost_autograd_sgd_multiple_inputs() and returns: qml