class_docstr: Test class for `CramersV` metric.
class_docstr_tok: ["Test","class","for","`","CramersV","`","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_cramers_v_differentiability(
      self,
      preds,
      target,
      bias_correction,
      nan_strategy,
      nan_replace_value,
  ):
      """Test the differentiability of the metric, according to its `is_differentiable` attribute."""
      metric_args = {
          "bias_correction": bias_correction,
          "nan_strategy": nan_strategy,
          "nan_replace_value": nan_replace_value,
          "num_classes": NUM_CLASSES,
      }
      self.run_differentiability_test(
          preds,
          target,
          metric_module=CramersV,
          metric_functional=cramers_v,
          metric_args=metric_args,
      )
  
file_path: torchmetrics/tests/unittests/nominal/test_cramers.py
imports: import itertools
  import operator
  from functools import partial
  import pytest
  import torch
  from dython.nominal import cramers_v
  from lightning_utilities.core.imports import compare_version
  from torchmetrics.functional.nominal.cramers import cramers_v, cramers_v_matrix
  from torchmetrics.nominal.cramers import CramersV
  from unittests import BATCH_SIZE, NUM_BATCHES, _Input
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 3 for calling the TestCramersV obj's underlying member method code with example usage: obj.test_cramers_v_differentiability(preds, target, bias_correction, nan_strategy, nan_replace_value) without return types