class_docstr: Tests for the SPSA gradient transform
class_docstr_tok: ["Tests","for","the","SPSA","gradient","transform"]
docstr: Test that an error is raised for a broadcasted/batched tape.
docstr_tok: ["Test","that","an","error","is","raised","for","a","broadcasted\/batched","tape","."]
code: def test_batched_tape_raises(self):
      """Test that an error is raised for a broadcasted/batched tape."""
      tape = qml.tape.QuantumScript(
          [qml.RX([0.4, 0.2], 0)], [qml.expval(qml.PauliZ(0))]
      )
      _match = "Computing the gradient of broadcasted tapes with the SPSA gradient transform"
      with pytest.raises(NotImplementedError, match=_match):
          spsa_grad(tape)
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.devices import DefaultQubitLegacy
  from pennylane.gradients import spsa_grad
  from pennylane.gradients.spsa_gradient import _rademacher_sampler
  from pennylane.operation import AnyWires, Observable
label_desc: Use image node_id 3 for calling the TestSpsaGradient obj's underlying member method code with example usage: obj.test_batched_tape_raises() without return types