class_docstr: Test the gradient of qml.math.fidelity
docstr: Test gradients are correct for a broadcasted input for tf
code: def test_broadcast_tf(
      self, cost_fn, expected_res, expected_grad, tol
  ):
      """Test gradients are correct for a broadcasted input for tf"""
      x = tf.Variable(
          [0.0, 1e-7, 0.456, np.pi / 2 - 1e-7, np.pi / 2],
          trainable=True,
      )
  
      with tf.GradientTape() as tape:
          res = cost_fn(x)
  
      grad = tape.gradient(res, x)
  
      assert qml.math.allclose(res, expected_res(x), tol)
      assert qml.math.allclose(grad, expected_grad(x), tol)
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 10 for calling the TestGradient obj's underlying member method code with example usage: obj.test_broadcast_tf(cost_fn, expected_res, expected_grad, tol) without return types