code: def cosine_similarity(y_true, y_pred):
      y_pred = ivy.asarray(y_pred)
      y_true = ivy.asarray(y_true)
  
      if (
          len(y_pred.shape) == len(y_pred.shape)
          and len(y_true.shape) == 2
      ):
          numerator = ivy.sum(y_true * y_pred, axis=1)
      else:
          numerator = ivy.vecdot(y_true, y_pred)
      denominator = ivy.matrix_norm(y_true) * ivy.matrix_norm(y_pred)
      return numerator / denominator
  
imports: import ivy
  from ivy.functional.frontends.tensorflow.func_wrapper import to_ivy_arrays_and_back
label_desc: Use image node_id 10 for calling a global function with example usage: cosine_similarity(y_true, y_pred) and returns: unknown