class_docstr: Test class for `CLIPScore` metric.
class_docstr_tok: ["Test","class","for","`","CLIPScore","`","metric","."]
docstr: Test class implementation of metric.
docstr_tok: ["Test","class","implementation","of","metric","."]
code: def test_clip_score(self, inputs, model_name_or_path, ddp):
      """Test class implementation of metric."""
      # images are preds and targets are captions
      preds, target = inputs
      self.run_class_metric_test(
          ddp=ddp,
          preds=preds,
          target=target,
          metric_class=CLIPScore,
          reference_metric=partial(
              _compare_fn, model_name_or_path=model_name_or_path
          ),
          metric_args={"model_name_or_path": model_name_or_path},
          check_scriptable=False,
          check_state_dict=False,
          check_batch=False,
      )
  
imports: from functools import partial
  from typing import List, NamedTuple
  import matplotlib
  import matplotlib.pyplot
  import pytest
  import torch
  from torch import Tensor
  from torchmetrics.functional.multimodal.clip_score import clip_score
  from torchmetrics.multimodal.clip_score import CLIPScore
  from torchmetrics.utilities.imports import _TRANSFORMERS_GREATER_EQUAL_4_10
  from transformers import CLIPModel
  from transformers import CLIPProcessor
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester
  from unittests.text.helpers import skip_on_connection_issues
label_desc: Use image node_id 1 for calling the TestCLIPScore obj's underlying member method code with example usage: obj.test_clip_score(inputs, model_name_or_path, ddp) without return types