class_docstr: Test class for `CHRFScore` metric.
class_docstr_tok: ["Test","class","for","`","CHRFScore","`","metric","."]
docstr: Test the differentiability of the metric, according to its `is_differentiable` attribute.
docstr_tok: ["Test","the","differentiability","of","the","metric",",","according","to","its","`","is_differentiable","`","attribute","."]
code: def test_chrf_score_differentiability(
      self,
      preds,
      targets,
      char_order,
      word_order,
      lowercase,
      whitespace,
  ):
      """Test the differentiability of the metric, according to its `is_differentiable` attribute."""
      metric_args = {
          "n_char_order": char_order,
          "n_word_order": word_order,
          "lowercase": lowercase,
          "whitespace": whitespace,
      }
  
      self.run_differentiability_test(
          preds=preds,
          targets=targets,
          metric_module=CHRFScore,
          metric_functional=chrf_score,
          metric_args=metric_args,
      )
  
file_path: torchmetrics/tests/unittests/text/test_chrf.py
imports: from functools import partial
  from typing import Sequence
  import pytest
  from torch import Tensor, tensor
  from torchmetrics.functional.text.chrf import chrf_score
  from torchmetrics.text.chrf import CHRFScore
  from torchmetrics.utilities.imports import _SACREBLEU_AVAILABLE
  from unittests.text.helpers import TextTester
  from unittests.text.inputs import _inputs_multiple_references, _inputs_single_sentence_multiple_references
label_desc: Use image node_id 3 for calling the TestCHRFScore obj's underlying member method code with example usage: obj.test_chrf_score_differentiability(preds, targets, char_order, word_order, lowercase, whitespace) without return types