code: def bind_custom_gradient_function(func, custom_grad_fn):
      @tf.custom_gradient
      def custom_module(x):
          x, _, _, _, _ = _get_required_float_variables(
              x, xs_grad_idxs=None
          )
          ret = func(x)
  
          def grad(upstream):
              return custom_grad_fn((x, ret), upstream)
  
          return ivy.to_native(
              (ret, grad), nested=True, include_derived=True
          )
  
      return inputs_to_native_arrays(custom_module)
  
file_path: ivy/ivy/functional/backends/tensorflow/experimental/gradients.py
imports: import tensorflow
  from typing import Callable
  import ivy
  from ivy.func_wrapper import inputs_to_native_arrays
  from ivy.functional.ivy.gradients import _get_required_float_variables
  from ivy.functional.ivy.gradients import _flatten_containers, _rebuild_flattened_containers
label_desc: Use image node_id 1 for calling a global function with example usage: bind_custom_gradient_function(func, custom_grad_fn) and returns: inputs_to_native_arrays, ivy, custom_grad_fn