class_docstr: Tests for the state function
class_docstr_tok: ["Tests","for","the","state","function"]
docstr: Test that the gradient of the state is accessible when using default.qubit.tf with the
  backprop diff_method.
docstr_tok: ["Test","that","the","gradient","of","the","state","is","accessible","when","using","default.qubit.tf","with","the","backprop","diff_method","."]
code: def test_gradient_with_passthru_tf(self):
      """Test that the gradient of the state is accessible when using default.qubit.tf with the
      backprop diff_method."""
      import tensorflow as tf
  
      dev = qml.device("default.qubit.tf", wires=1)
  
      @qml.qnode(dev, interface="tf", diff_method="backprop")
      def func(x):
          qml.RY(x, wires=0)
          return state()
  
      x = tf.Variable(0.1, dtype=tf.float64)
  
      with tf.GradientTape() as tape:
          result = func(x)
  
      grad = tape.jacobian(result, x)
      expected = tf.stack([-0.5 * tf.sin(x / 2), 0.5 * tf.cos(x / 2)])
      assert np.allclose(grad, expected)
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.devices import DefaultQubitLegacy
  from pennylane.measurements import State, Shots, density_matrix, expval, state
label_desc: Use image node_id 14 for calling the TestState obj's underlying member method code with example usage: obj.test_gradient_with_passthru_tf() and returns: state