class_docstr: Test errors raised by stoch_pulse_grad.
class_docstr_tok: ["Test","errors","raised","by","stoch_pulse_grad","."]
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 stochastic pulse"
      with pytest.raises(NotImplementedError, match=_match):
          stoch_pulse_grad(tape)
  
imports: import warnings
  import copy
  import pytest
  import numpy
  import pennylane
  from pennylane.gradients.general_shift_rules import eigvals_to_frequencies, generate_shift_rule
  from pennylane.gradients.pulse_gradient import _parshift_and_integrate, _split_evol_ops, _split_evol_tape, stoch_pulse_grad
label_desc: Use image node_id 4 for calling the TestStochPulseGradErrors obj's underlying member method code with example usage: obj.test_batched_tape_raises() without return types