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, shots, device):
      """Test re-using a quantum tape by passing new parameters"""
      a = tf.Variable(0.1)
      b = tf.Variable(0.2)
  
      tape = qml.tape.QuantumScript(
          [qml.RY(a, 0), qml.RX(b, 1), qml.CNOT((0, 1))],
          [qml.expval(qml.PauliZ(0)), qml.expval(qml.PauliY(1))],
      )
      assert tape.trainable_params == [0, 1]
  
      def cost(a, b):
          new_tape = tape.bind_new_parameters([a, b], [0, 1])
          return qml.math.hstack(
              execute([new_tape], device, **execute_kwargs)[0],
              like="tensorflow",
          )
  
      with tf.GradientTape() as t:
          res = cost(a, b)
  
      jac = 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():
          res2 = cost(2 * a, b)
  
      expected = [tf.cos(2 * a), -tf.cos(2 * a) * tf.sin(b)]
      assert np.allclose(
          res2, expected, atol=atol_for_shots(shots), rtol=0
      )
  
      with tf.GradientTape() as t:
          res = cost(2 * a, b)
  
      jac = t.jacobian(res, [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 isinstance(jac, list) and len(jac) == 2
      for _j, _e in zip(jac, expected):
          assert np.allclose(_j, _e, atol=atol_for_shots(shots), rtol=0)
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.devices import DefaultQubit
  from pennylane.gradients import param_shift
  from pennylane import execute
label_desc: Use image node_id 6 for calling the TestTensorflowExecuteIntegration obj's underlying member method code with example usage: obj.test_reusing_quantum_tape(execute_kwargs, shots, device) and returns: qml