class_docstr: Test the TensorFlow interface execute function
  integrates well for both forward and backward execution
class_docstr_tok: ["Test","the","TensorFlow","interface","execute","function","integrates","well","for","both","forward","and","backward","execution"]
docstr: Test re-using a quantum tape by passing new parameters
docstr_tok: ["Test","re-using","a","quantum","tape","by","passing","new","parameters"]
code: def test_reusing_quantum_tape(self, execute_kwargs, tol):
      """Test re-using a quantum tape by passing new parameters"""
      a = tf.Variable(0.1, dtype=tf.float64)
      b = tf.Variable(0.2, dtype=tf.float64)
  
      dev = qml.device("default.qubit.legacy", wires=2)
  
      with tf.GradientTape() as t:
          with qml.queuing.AnnotatedQueue() as q:
              qml.RY(a, wires=0)
              qml.RX(b, wires=1)
              qml.CNOT(wires=[0, 1])
              qml.expval(qml.PauliZ(0))
              qml.expval(qml.PauliY(1))
  
          tape = qml.tape.QuantumScript.from_queue(q)
          assert tape.trainable_params == [0, 1]
          res = execute([tape], dev, **execute_kwargs)[0]
          res = tf.stack(res)
  
      t.jacobian(res, [a, b])
  
      a = tf.Variable(0.54, dtype=tf.float64)
      b = tf.Variable(0.8, dtype=tf.float64)
  
      # check that the cost function continues to depend on the
      # values of the parameters for subsequent calls
      with tf.GradientTape() as t:
          tape = tape.bind_new_parameters([2 * a, b], [0, 1])
          res2 = execute([tape], dev, **execute_kwargs)[0]
          res2 = tf.stack(res2)
  
      expected = [tf.cos(2 * a), -tf.cos(2 * a) * tf.sin(b)]
      assert np.allclose(res2, expected, atol=tol, rtol=0)
  
      jac2 = t.jacobian(res2, [a, b])
      expected = [
          [-2 * tf.sin(2 * a), 2 * tf.sin(2 * a) * tf.sin(b)],
          [0, -tf.cos(2 * a) * tf.cos(b)],
      ]
      assert np.allclose(jac2, expected, atol=tol, rtol=0)
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.gradients import finite_diff, param_shift
  from pennylane import execute
label_desc: Use image node_id 5 for calling the TestTensorFlowExecuteIntegration obj's underlying member method code with example usage: obj.test_reusing_quantum_tape(execute_kwargs, tol) without return types