class_docstr: Test gradients for multiple measurements
class_docstr_tok: ["Test","gradients","for","multiple","measurements"]
docstr: Test derivatives when using TF
docstr_tok: ["Test","derivatives","when","using","TF"]
code: def test_tf(self, diff_method, tol, interface):
      """Test derivatives when using TF"""
      import tensorflow as tf
  
      dev = qml.device("default.qubit", wires=2)
  
      @qml.batch_params
      @qml.qnode(dev, diff_method=diff_method, interface=interface)
      def circuit(x):
          qml.RY(x, wires=0)
          qml.CNOT(wires=[0, 1])
          return qml.expval(qml.PauliZ(0)), qml.probs(wires=[0, 1])
  
      batch_size = 3
      x = tf.Variable(np.linspace(0.1, 0.5, batch_size))
  
      with tf.GradientTape() as tape:
          res = circuit(x)
          res = qml.math.concatenate(
              [qml.math.expand_dims(res[0], 1), res[1]], axis=1
          )
  
      expected = qml.math.transpose(
          qml.math.stack(
              [
                  np.cos(x),
                  np.cos(x / 2) ** 2,
                  np.zeros_like(x),
                  np.zeros_like(x),
                  np.sin(x / 2) ** 2,
              ]
          )
      )
      assert qml.math.allclose(res, expected, atol=tol)
  
      grad = tape.jacobian(res, x)
      expected = qml.math.stack(
          [
              -np.sin(x),
              -np.sin(x) / 2,
              np.zeros_like(x),
              np.zeros_like(x),
              np.sin(x) / 2,
          ]
      ) * qml.math.expand_dims(np.eye(batch_size), 1)
  
      assert np.allclose(grad, expected, atol=tol, rtol=0)
  
imports: import functools
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 5 for calling the TestDiffMulti obj's underlying member method code with example usage: obj.test_tf(diff_method, tol, interface) and returns: qml,  qml