code: def test_value_and_grad(x, dtype, func, backend_fw):
      if backend_fw == "numpy":
          return
      with BackendHandler.update_backend(backend_fw) as ivy_backend:
          var = ivy_backend.ivy.functional.ivy.gradients._variable(
              ivy_backend.array(x, dtype=dtype)
          )
          fn = ivy_backend.value_and_grad(func)
          value, grad = fn(var)
          value_np, grad_np = helpers.flatten_and_to_np(
              ret=value, backend=backend_fw
          ), helpers.flatten_and_to_np(ret=grad, backend=backend_fw)
  
      with BackendHandler.update_backend("tensorflow") as gt_backend:
          var = gt_backend.ivy.functional.ivy.gradients._variable(
              gt_backend.array(x, dtype=dtype)
          )
          fn = gt_backend.value_and_grad(func)
          value_gt, grad_gt = fn(var)
          value_np_from_gt, grad_np_from_gt = helpers.flatten_and_to_np(
              ret=value_gt, backend="tensorflow"
          ), helpers.flatten_and_to_np(
              ret=grad_gt, backend="tensorflow"
          )
  
      for value, value_from_gt in zip(value_np, value_np_from_gt):
          assert value.shape == value_from_gt.shape
          assert np.allclose(value, value_from_gt)
      for grad, grad_from_gt in zip(grad_np, grad_np_from_gt):
          assert grad.shape == grad_from_gt.shape
          assert np.allclose(grad, grad_from_gt)
  
file_path: ivy/ivy_tests/test_ivy/test_functional/test_core/test_gradients.py
imports: from hypothesis import strategies
  import pytest
  import numpy
  import ivy
  import ivy_tests.test_ivy.helpers
  from ivy_tests.test_ivy.helpers import handle_test, BackendHandler
label_desc: Use image node_id 12 for calling a global function with example usage: test_value_and_grad(x, dtype, func, backend_fw) without return types