class_docstr: Test the Nesterov Momentum optimizer
docstr: Test that the correct cost is returned via the step_and_cost method for the
  Nesterov momentum optimizer
docstr_tok: ["Test","that","the","correct","cost","is","returned","via","the","step_and_cost","method","for","the","Nesterov","momentum","optimizer"]
code: def test_step_and_cost_autograd_nesterov_multid_array(self):
      """Test that the correct cost is returned via the step_and_cost method for the
      Nesterov momentum optimizer"""
      stepsize, gamma = 0.1, 0.5
      nesmom_opt = NesterovMomentumOptimizer(stepsize, momentum=gamma)
      multid_array = np.array([[0.1, 0.2], [-0.1, -0.4]])
  
      @qml.qnode(qml.device("default.qubit", wires=1))
      def quant_fun_mdarr(var):
          qml.RX(var[0, 1], wires=[0])
          qml.RY(var[1, 0], wires=[0])
          qml.RY(var[1, 1], wires=[0])
          return qml.expval(qml.PauliZ(0))
  
      _, res = nesmom_opt.step_and_cost(quant_fun_mdarr, multid_array)
      expected = quant_fun_mdarr(multid_array)
  
      assert np.all(res == expected)
  
file_path: pennylane/tests/optimize/test_nesterov_momentum.py
imports: import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.optimize import NesterovMomentumOptimizer
label_desc: Use image node_id 2 for calling the TestNesterovMomentumOptimizer obj's underlying member method code with example usage: obj.test_step_and_cost_autograd_nesterov_multid_array() and returns: qml