class_docstr: Test class for `InfoLM` metric.
docstr: Test class implementation of metric.
docstr_tok: ["Test","class","implementation","of","metric","."]
code: def test_infolm_class(
      self, ddp, preds, targets, information_measure, idf, alpha, beta
  ):
      """Test class implementation of metric."""
      metric_args = {
          "model_name_or_path": MODEL_NAME,
          "information_measure": information_measure,
          "idf": idf,
          "alpha": alpha,
          "beta": beta,
          "max_length": MAX_LENGTH,
      }
      reference_metric = partial(
          reference_infolm_score,
          model_name=MODEL_NAME,
          information_measure=information_measure,
          idf=idf,
          alpha=alpha,
          beta=beta,
      )
  
      self.run_class_metric_test(
          ddp=ddp,
          preds=preds,
          targets=targets,
          metric_class=InfoLM,
          reference_metric=reference_metric,
          metric_args=metric_args,
          check_scriptable=False,  # huggingface transformers are not usually scriptable
      )
  
file_path: torchmetrics/tests/unittests/text/test_infolm.py
imports: from functools import partial
  import pytest
  import torch
  from torchmetrics.functional.text.infolm import infolm
  from torchmetrics.text.infolm import InfoLM
  from torchmetrics.utilities.imports import _TRANSFORMERS_GREATER_EQUAL_4_4
  from unittests.text.helpers import TextTester, skip_on_connection_issues
  from unittests.text.inputs import HYPOTHESIS_A, HYPOTHESIS_C, _inputs_single_reference
label_desc: Use image node_id 1 for calling the TestInfoLM obj's underlying member method code with example usage: obj.test_infolm_class(ddp, preds, targets, information_measure, idf, alpha, beta) without return types