class_docstr: Tests for the batch_transform decorator differentiability
class_docstr_tok: ["Tests","for","the","batch_transform","decorator","differentiability"]
docstr: Generates two tapes, one with all RX replaced with RY,
  and the other with all RX replaced with RZ.
docstr_tok: ["Generates","two","tapes",",","one","with","all","RX","replaced","with","RY",",","and","the","other","with","all","RX","replaced","with","RZ","."]
code: def my_transform(tape, weights):
      """Generates two tapes, one with all RX replaced with RY,
      and the other with all RX replaced with RZ."""
  
      q_tape1 = qml.queuing.AnnotatedQueue()
      q_tape2 = qml.queuing.AnnotatedQueue()
  
      # loop through all operations on the input tape
      for op in tape:
          if op.name == "RX":
              wires = op.wires
              param = op.parameters[0]
  
              with q_tape1:
                  qml.RY(weights[0] * qml.math.sin(param), wires=wires)
  
              with q_tape2:
                  qml.RZ(weights[1] * qml.math.cos(param), wires=wires)
          else:
              for t in [q_tape1, q_tape2]:
                  with t:
                      qml.apply(op)
  
      tape1 = qml.tape.QuantumScript.from_queue(q_tape1)
      tape2 = qml.tape.QuantumScript.from_queue(q_tape2)
  
      def processing_fn(results):
          return qml.math.sum(qml.math.stack(results))
  
      return [tape1, tape2], processing_fn
  
imports: import functools
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 1 for calling the TestBatchTransformGradients obj's underlying member method code with example usage: obj.my_transform(tape, weights) and returns: list,  processing_fn, qml