class_docstr: Test gradients for multiple measurements
class_docstr_tok: ["Test","gradients","for","multiple","measurements"]
docstr: Test derivatives when using TF and autograph
docstr_tok: ["Test","derivatives","when","using","TF","and","autograph"]
code: def test_tf_autograph(self, diff_method, tol, interface):
      """Test derivatives when using TF and autograph"""
      import tensorflow as tf
  
      dev = qml.device("default.qubit", wires=2)
  
      @tf.function
      @partial(qml.batch_input, argnum=0)
      @qml.qnode(dev, diff_method=diff_method, interface=interface)
      def circuit(input, x):
          qml.RY(input, wires=0)
          qml.RY(x, wires=0)
          qml.CNOT(wires=[0, 1])
          return qml.expval(qml.PauliZ(0)), qml.probs(wires=[0, 1])
  
      batch_size = 3
      input = tf.Variable(
          np.linspace(0.1, 0.5, batch_size), trainable=False
      )
      x = tf.Variable(0.1, trainable=True, dtype=tf.float64)
  
      with tf.GradientTape() as tape:
          res = circuit(input, 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(input + x),
                  np.cos((input + x) / 2) ** 2,
                  np.zeros_like(input),
                  np.zeros_like(input),
                  np.sin((input + x) / 2) ** 2,
              ]
          )
      )
      assert qml.math.allclose(res, expected, atol=tol)
  
      grad = tape.jacobian(res, x)
      expected = qml.math.transpose(
          qml.math.stack(
              [
                  -np.sin(input + x),
                  -np.sin(input + x) / 2,
                  np.zeros_like(input),
                  np.zeros_like(input),
                  np.sin(input + x) / 2,
              ]
          )
      )
      assert qml.math.allclose(grad, expected, atol=tol, rtol=0)
  
imports: from functools import partial
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 6 for calling the TestDiffMulti obj's underlying member method code with example usage: obj.test_tf_autograph(diff_method, tol, interface) and returns: qml,  qml