class_docstr: A link prediction metric to compute the Normalized Discounted
  Cumulative Gain (NDCG).
  
  Args:
      k (int): The number of top-:math:`k` predictions to evaluate against.
class_docstr_tok: ["A","link","prediction","metric","to","compute","the","Normalized","Discounted","Cumulative","Gain","(","NDCG",")",".","Args",":","k","(","int",")",":","The","number","of","top-",":","math",":","`","k","`","predictions","to","evaluate","against","."]
code: def _compute(self, pred_isin_mat: Tensor, y_count: Tensor) -> Tensor:
      dcg = (pred_isin_mat * self.multiplier.view(1, -1)).sum(dim=-1)
      idcg = self.idcg[y_count.clamp(max=self.k)]
  
      out = dcg / idcg
      out[out.isnan() | out.isinf()] = 0.0
      return out
  
imports: from abc import ABC, abstractmethod
  from typing import Optional, Tuple, Union
  import torch
  from torch import Tensor
  from torch_geometric.utils import cumsum, scatter
label_desc: Use image node_id 2 for calling the LinkPredNDCG obj's underlying member method code with example usage: obj._compute(pred_isin_mat, y_count) and returns: out