code: def test_kl_div(
      dtype_and_input,
      dtype_and_target,
      reduction,
      log_target,
      test_flags,
      backend_fw,
      fn_name,
      on_device,
  ):
      input_dtype, input = dtype_and_input
      input[0] = np.log(input[0])
      target_dtype, target = dtype_and_target
      if log_target:
          target[0] = np.log(target[0])
      helpers.test_function(
          input_dtypes=input_dtype + target_dtype,
          test_flags=test_flags,
          backend_to_test=backend_fw,
          fn_name=fn_name,
          on_device=on_device,
          atol_=1e-02,
          input=input[0],
          target=target[0],
          reduction=reduction,
          log_target=log_target,
      )
  
file_path: ivy/ivy_tests/test_ivy/test_functional/test_experimental/test_nn/test_losses.py
imports: from hypothesis import strategies
  import numpy
  import ivy_tests.test_ivy.helpers
  from ivy_tests.test_ivy.helpers import handle_test
label_desc: Use image node_id 4 for calling a global function with example usage: test_kl_div(dtype_and_input, dtype_and_target, reduction, log_target, test_flags, backend_fw, fn_name, on_device) without return types