class_docstr: Test class for `CosineSimilarity` metric.
class_docstr_tok: ["Test","class","for","`","CosineSimilarity","`","metric","."]
docstr: Test functional implementation of metric.
docstr_tok: ["Test","functional","implementation","of","metric","."]
code: def test_cosine_similarity_functional(
      self, reduction, preds, target, ref_metric
  ):
      """Test functional implementation of metric."""
      self.run_functional_metric_test(
          preds,
          target,
          cosine_similarity,
          partial(ref_metric, reduction=reduction),
          metric_args={"reduction": reduction},
      )
  
file_path: torchmetrics/tests/unittests/regression/test_cosine_similarity.py
imports: from functools import partial
  import numpy
  import pytest
  import torch
  from sklearn.metrics.pairwise import cosine_similarity
  from torchmetrics.functional.regression.cosine_similarity import cosine_similarity
  from torchmetrics.regression.cosine_similarity import CosineSimilarity
  from unittests import BATCH_SIZE, NUM_BATCHES, _Input
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 2 for calling the TestCosineSimilarity obj's underlying member method code with example usage: obj.test_cosine_similarity_functional(reduction, preds, target, ref_metric) without return types