class_docstr: Test class for `RetrievalNormalizedDCG` metric.
class_docstr_tok: ["Test","class","for","`","RetrievalNormalizedDCG","`","metric","."]
docstr: Test class implementation of metric with ignore_index argument.
docstr_tok: ["Test","class","implementation","of","metric","with","ignore_index","argument","."]
code: def test_class_metric_ignore_index(
      self,
      ddp: bool,
      indexes: Tensor,
      preds: Tensor,
      target: Tensor,
      empty_target_action: str,
      k: int,
  ):
      """Test class implementation of metric with ignore_index argument."""
      metric_args = {
          "empty_target_action": empty_target_action,
          "top_k": k,
          "ignore_index": -100,
      }
  
      self.run_class_metric_test(
          ddp=ddp,
          indexes=indexes,
          preds=preds,
          target=target,
          metric_class=RetrievalNormalizedDCG,
          reference_metric=_ndcg_at_k,
          metric_args=metric_args,
      )
  
imports: from typing import Callable, Optional, Union
  import numpy
  import pytest
  import torch
  from sklearn.metrics import ndcg_score
  from torch import Tensor
  from torchmetrics.functional.retrieval.ndcg import retrieval_normalized_dcg
  from torchmetrics.retrieval.ndcg import RetrievalNormalizedDCG
  from typing_extensions import Literal
  from unittests.helpers import seed_all
  from unittests.retrieval.helpers import RetrievalMetricTester, _concat_tests, _custom_aggregate_fn, _default_metric_class_input_arguments_ignore_index, _default_metric_class_input_arguments_with_non_binary_target, _default_metric_functional_input_arguments_with_non_binary_target, _errors_test_class_metric_parameters_k, _errors_test_class_metric_parameters_with_nonbinary, _errors_test_functional_metric_parameters_k, _errors_test_functional_metric_parameters_with_nonbinary
label_desc: Use image node_id 2 for calling the TestNDCG obj's underlying member method code with example usage: obj.test_class_metric_ignore_index(ddp, indexes, preds, target, empty_target_action, k) without return types