code: def cosine_similarity(x1, x2):
      axis = None
      if len(x1.shape) == len(x2.shape) and len(x2.shape) == 2:
          axis = 1
      input1_norm = norm(x1, axis=axis)
      input2_norm = norm(x2, axis=axis)
      norm_mm = input1_norm * input2_norm
      norm_mm, eps = torch_frontend.promote_types_of_torch_inputs(
          norm_mm, 1e-08
      )
      return ivy.sum(x1 * x2, axis=axis) / ivy.maximum(norm_mm, eps)
  
imports: import ivy
  import ivy.functional.frontends.torch
  from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
  from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
label_desc: Use image node_id 9 for calling a global function with example usage: cosine_similarity(x1, x2) and returns: unknown