class_docstr: Test class for `Perplexity` 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_perplexity_differentiability(
      self, preds, target, ignore_index
  ):
      """Test the differentiability of the metric, according to its `is_differentiable` attribute."""
      self.run_differentiability_test(
          preds=preds,
          target=target,
          metric_module=Perplexity,
          metric_functional=perplexity,
          metric_args={"ignore_index": ignore_index},
      )
  
file_path: torchmetrics/tests/unittests/text/test_perplexity.py
imports: from functools import partial
  import pytest
  import torch
  from torch.nn import functional
  from torchmetrics.functional.text.perplexity import perplexity
  from torchmetrics.text.perplexity import Perplexity
  from unittests.helpers.testers import MetricTester
  from unittests.text.inputs import MASK_INDEX, _logits_inputs_fp32, _logits_inputs_fp32_with_mask, _logits_inputs_fp64, _logits_inputs_fp64_with_mask
label_desc: Use image node_id 3 for calling the TestPerplexity obj's underlying member method code with example usage: obj.test_perplexity_differentiability(preds, target, ignore_index) without return types