class_docstr: Tests for the batch_transform decorator differentiability
class_docstr_tok: ["Tests","for","the","batch_transform","decorator","differentiability"]
docstr: Test that a batch transform is differentiable when using
  TensorFlow
docstr_tok: ["Test","that","a","batch","transform","is","differentiable","when","using","TensorFlow"]
code: def test_differentiable_tf(self, diff_method):
      """Test that a batch transform is differentiable when using
      TensorFlow"""
      import tensorflow as tf
  
      dev = qml.device("default.qubit", wires=2)
      qnode = qml.QNode(self.circuit, dev, diff_method=diff_method)
  
      weights_np = np.array([0.1, 0.2], requires_grad=True)
      x_np = np.array(0.543, requires_grad=True)
      weights = tf.Variable(weights_np, dtype=tf.float64)
      x = tf.Variable(x_np, dtype=tf.float64)
  
      with tf.GradientTape() as tape:
          res = self.my_transform(qnode, weights)(x)
  
      assert np.allclose(res, self.expval(x, weights))
  
      grad = tape.gradient(res, [x, weights])
      expected = qml.grad(self.expval)(x_np, weights_np)
      assert len(grad) == len(expected)
      assert all(np.allclose(g, e) for g, e in zip(grad, expected))
  
imports: import functools
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 5 for calling the TestBatchTransformGradients obj's underlying member method code with example usage: obj.test_differentiable_tf(diff_method) without return types