class_docstr: Test class for `BLEUScore` metric.
class_docstr_tok: ["Test","class","for","`","BLEUScore","`","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_bleu_score_differentiability(
      self, preds, targets, weights, n_gram, smooth_func, smooth
  ):
      """Test the differentiability of the metric, according to its `is_differentiable` attribute."""
      metric_args = {"n_gram": n_gram, "smooth": smooth}
  
      self.run_differentiability_test(
          preds=preds,
          targets=targets,
          metric_module=BLEUScore,
          metric_functional=bleu_score,
          metric_args=metric_args,
      )
  
imports: from functools import partial
  from typing import Any
  import pytest
  from nltk.translate.bleu_score import SmoothingFunction, corpus_bleu
  from torch import tensor
  from torchmetrics.functional.text.bleu import bleu_score
  from torchmetrics.text.bleu import BLEUScore
  from unittests.text.helpers import TextTester
  from unittests.text.inputs import _inputs_multiple_references
label_desc: Use image node_id 3 for calling the TestBLEUScore obj's underlying member method code with example usage: obj.test_bleu_score_differentiability(preds, targets, weights, n_gram, smooth_func, smooth) without return types