class_docstr: Test that the template is compatible with all interfaces, including the computation
  of gradients.
class_docstr_tok: ["Test","that","the","template","is","compatible","with","all","interfaces",",","including","the","computation","of","gradients","."]
docstr: Test the tf interface.
docstr_tok: ["Test","the","tf","interface","."]
code: def test_tf(self, tol):
      """Test the tf interface."""
  
      import tensorflow as tf
  
      unitary_matrix = tf.Variable(
          [
              [
                  0.51378719 + 0.0j,
                  0.0546265 + 0.79145487j,
                  -0.2051466 + 0.2540723j,
              ],
              [
                  0.62651582 + 0.0j,
                  -0.00828925 - 0.60570321j,
                  -0.36704948 + 0.32528067j,
              ],
              [
                  -0.58608928 + 0.0j,
                  0.03902657 + 0.04633548j,
                  -0.57220635 + 0.57044649j,
              ],
          ]
      )
      weights = tf.Variable(
          [
              2.2707802713289267,
              2.9355948424220206,
              -1.4869222527726533,
              1.2601662579297865,
              2.3559705032936717,
              1.1748572730890159,
              2.2500537657656356,
              -0.7251404204443089,
              2.3577346350335198,
          ]
      )
  
      dev = qml.device("default.qubit", wires=3)
  
      circuit = qml.QNode(circuit_template, dev)
      circuit2 = qml.QNode(circuit_decomposed, dev)
  
      res = circuit(unitary_matrix)
      res2 = circuit2(weights)
      assert qml.math.allclose(res, res2, atol=tol, rtol=0)
  
      with tf.GradientTape() as tape:
          res = circuit(unitary_matrix)
      grads = tape.gradient(res, [unitary_matrix])
  
      assert grads[0] is None
  
file_path: pennylane/tests/templates/test_subroutines/test_basis_rotation.py
imports: import pytest
  import numpy
  import pennylane
label_desc: Use image node_id 3 for calling the TestInterfaces obj's underlying member method code with example usage: obj.test_tf(tol) without return types