class_docstr: Unit tests for the batch_transform class
class_docstr_tok: ["Unit","tests","for","the","batch_transform","class"]
docstr: Test that a parametrized transform can be applied
  to a QNode as a decorator
docstr_tok: ["Test","that","a","parametrized","transform","can","be","applied","to","a","QNode","as","a","decorator"]
code: def test_parametrized_transform_qnode_decorator(self, mocker):
      """Test that a parametrized transform can be applied
      to a QNode as a decorator"""
      a = 0.1
      b = 0.4
      x = 0.543
  
      dev = qml.device("default.qubit", wires=2)
  
      @self.my_transform(a, b)  # pylint: disable=no-value-for-parameter
      @qml.qnode(dev)
      def circuit(x):
          qml.Hadamard(wires=0)
          qml.RX(x, wires=0)
          return qml.expval(qml.PauliX(0))
  
      spy = mocker.spy(self.my_transform, "construct")
      res = circuit(x)
  
      spy.assert_called()
      tapes, fn = spy.spy_return
  
      assert len(tapes[0].operations) == 2
      assert tapes[0].operations[0].name == "Hadamard"
      assert tapes[0].operations[1].name == "RY"
      assert tapes[0].operations[1].parameters == [a * np.abs(x)]
  
      assert len(tapes[1].operations) == 2
      assert tapes[1].operations[0].name == "Hadamard"
      assert tapes[1].operations[1].name == "RZ"
      assert tapes[1].operations[1].parameters == [b * np.sin(x)]
  
      expected = fn(dev.execute(tapes))
      assert res == expected
  
imports: import functools
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 18 for calling the TestBatchTransform obj's underlying member method code with example usage: obj.test_parametrized_transform_qnode_decorator(mocker) and returns: qml