class_docstr: Non differentiability tests for the transform program keyword argument.
docstr: Test a transform that splits input tapes up into different sizes.
docstr_tok: ["Test","a","transform","that","splits","input","tapes","up","into","different","sizes","."]
code: def test_ragged_batch_sizes(self, dev, interface):
      """Test a transform that splits input tapes up into different sizes."""
  
      # note this does not work for partitioned shots
      def sum_measurements(results):
          return sum(results)
  
      def split_sum_terms(tape):
          sum_obj = tape.measurements[0].obs
          new_tapes = tuple(
              qml.tape.QuantumScript(
                  tape.operations, [qml.expval(o)], shots=tape.shots
              )
              for o in sum_obj
          )
  
          return new_tapes, sum_measurements
  
      container = qml.transforms.core.TransformContainer(
          split_sum_terms
      )
      prog = qml.transforms.core.TransformProgram((container,))
  
      op = qml.RX(1.2, 0)
      tape1 = qml.tape.QuantumScript(
          [op], [qml.expval(qml.sum(qml.PauliX(0), qml.PauliZ(0)))]
      )
      tape2 = qml.tape.QuantumScript(
          [op],
          [
              qml.expval(
                  qml.sum(qml.PauliX(0), qml.PauliY(0), qml.PauliZ(0))
              )
          ],
      )
      tape3 = qml.tape.QuantumScript(
          [op],
          [qml.expval(qml.sum(*(qml.PauliZ(i) for i in range(5))))],
      )
      with dev.tracker:
          results = qml.execute(
              (tape1, tape2, tape3),
              dev,
              interface=interface,
              transform_program=prog,
          )
  
      assert qml.math.allclose(results[0], np.cos(1.2))
      assert qml.math.allclose(results[1], -np.sin(1.2) + np.cos(1.2))
      assert qml.math.allclose(results[2], 4 + np.cos(1.2))
  
      assert dev.tracker.totals["executions"] == 7
  
file_path: pennylane/tests/interfaces/test_transform_program_integration.py
imports: import copy
  from typing import Tuple, Callable
  from functools import partial
  import pytest
  import numpy
  import pennylane
label_desc: Use image node_id 4 for calling the TestTransformProgram obj's underlying member method code with example usage: obj.test_ragged_batch_sizes(dev, interface) and returns: sum, new_tapes,  sum_measurements