class_docstr: Tests that the template is compatible with all interfaces, including the computation
  of gradients.
class_docstr_tok: ["Tests","that","the","template","is","compatible","with","all","interfaces",",","including","the","computation","of","gradients","."]
docstr: Tests the tf interface.
docstr_tok: ["Tests","the","tf","interface","."]
code: def test_tf(self, tol, features):
      """Tests the tf interface."""
  
      import tensorflow as tf
  
      features = tf.Variable(features)
  
      dev = qml.device("default.qubit", wires=2)
  
      circuit = qml.QNode(circuit_template, dev)
      circuit2 = qml.QNode(circuit_decomposed, dev)
  
      res = circuit(features)
      res2 = circuit2(features)
      assert qml.math.allclose(res, res2, atol=tol, rtol=0)
  
      with tf.GradientTape() as tape:
          res = circuit(features)
      grads = tape.jacobian(res, [features])
  
      with tf.GradientTape() as tape2:
          res2 = circuit2(features)
      grads2 = tape2.jacobian(res2, [features])
  
      assert np.allclose(grads[0], grads2[0], atol=tol, rtol=0)
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 4 for calling the TestInterfaces obj's underlying member method code with example usage: obj.test_tf(tol, features) without return types