code: def test_torch_nll_loss(
      *,
      dtype_and_input,
      dtype_and_target,
      dtype_and_weights,
      size_average,
      reduce,
      reduction,
      on_device,
      fn_tree,
      frontend,
      test_flags,
      backend_fw,
  ):
      inputs_dtype, input = dtype_and_input
      target_dtype, target = dtype_and_target
      weights_dtype, weights = dtype_and_weights
      helpers.test_frontend_function(
          input_dtypes=inputs_dtype + target_dtype + weights_dtype,
          backend_to_test=backend_fw,
          frontend=frontend,
          test_flags=test_flags,
          fn_tree=fn_tree,
          on_device=on_device,
          input=input[0],
          target=target[0],
          weight=weights[0],
          size_average=size_average,
          reduce=reduce,
          reduction=reduction,
      )
  
imports: import numpy
  from hypothesis import strategies
  import ivy_tests.test_ivy.helpers
  from ivy_tests.test_ivy.helpers import handle_frontend_test
  import ivy
  from ivy.functional.frontends.torch.nn.functional.loss_functions import cosine_similarity
label_desc: Use image node_id 14 for calling a global function with example usage: test_torch_nll_loss() without return types