code: def test_torch_cosine_embedding_loss(
      *,
      dtype_and_inputs,
      margin,
      size_average,
      reduce,
      reduction,
      test_flags,
      fn_tree,
      backend_fw,
      frontend,
      on_device,
  ):
      input_dtype, x = dtype_and_inputs
      input1_dtype, input1 = input_dtype[0], x[0]
      input2_dtype, input2 = input_dtype[1], x[1]
  
      ivy.set_backend(backend_fw)
      if input1.ndim == input2.ndim == 1:
          tar = ivy.array(1.0)
      else:
          third = input1.shape[0] // 3
          ones = ivy.ones(input1.shape[0] - (third * 2))
          minus_ones = ivy.ones(third) * -1
          randoms = ivy.random_uniform(shape=[third])
          tar = ivy.hstack((ones, minus_ones, randoms)).shuffle()
  
      helpers.test_frontend_function(
          input_dtypes=[input1_dtype, input2_dtype],
          backend_to_test=backend_fw,
          frontend=frontend,
          test_flags=test_flags,
          fn_tree=fn_tree,
          on_device=on_device,
          input1=input1,
          input2=input2,
          target=tar,
          margin=margin,
          size_average=size_average,
          reduce=reduce,
          reduction=reduction,
      )
  
      ivy.previous_backend()
  
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 3 for calling a global function with example usage: test_torch_cosine_embedding_loss() without return types