class_docstr: This class implements the RecMetricComputation for NDCG, i.e. Normalized Discounted Cumulative Gain.
  
  The constructor arguments are defined in RecMetricComputation.
  See the docstring of RecMetricComputation for more detail.
class_docstr_tok: ["This","class","implements","the","RecMetricComputation","for","NDCG",",","i.e",".","Normalized","Discounted","Cumulative","Gain",".","The","constructor","arguments","are","defined","in","RecMetricComputation",".","See","the","docstring","of","RecMetricComputation","for","more","detail","."]
code: def _compute(self) -> List[MetricComputationReport]:
      return [
          MetricComputationReport(
              name=MetricName.NDCG,
              metric_prefix=MetricPrefix.LIFETIME,
              value=compute_ndcg(
                  sum_ndcg=cast(torch.Tensor, getattr(self, SUM_NDCG)),
                  num_sessions=cast(
                      torch.Tensor, getattr(self, NUM_SESSIONS)
                  ),
              ),
          ),
          MetricComputationReport(
              name=MetricName.NDCG,
              metric_prefix=MetricPrefix.WINDOW,
              value=compute_ndcg(
                  sum_ndcg=self.get_window_state(SUM_NDCG),
                  num_sessions=self.get_window_state(NUM_SESSIONS),
              ),
          ),
      ]
  
imports: from typing import Any, cast, Dict, List, Optional, Type
  import torch
  from torch import distributed
  from torchrec.metrics.metrics_config import RecComputeMode, RecTaskInfo
  from torchrec.metrics.metrics_namespace import MetricName, MetricNamespace, MetricPrefix
  from torchrec.metrics.rec_metric import MetricComputationReport, RecMetric, RecMetricComputation, RecMetricException
label_desc: Use image node_id 3 for calling the NDCGComputation obj's underlying member method code with example usage: obj._compute() and returns: list