class_docstr: An abstract class for computing link prediction retrieval metrics.
  
  Args:
      k (int): The number of top-:math:`k` predictions to evaluate against.
class_docstr_tok: ["An","abstract","class","for","computing","link","prediction","retrieval","metrics",".","Args",":","k","(","int",")",":","The","number","of","top-",":","math",":","`","k","`","predictions","to","evaluate","against","."]
docstr: Compute the specific metric.
  To be implemented separately for each metric class.
  
  Args:
      pred_isin_mat (torch.Tensor): A boolean matrix whose :obj:`(i,k)`
          element indicates if the :obj:`k`-th prediction for the
          :obj:`i`-th example is correct or not.
      y_count (torch.Tensor): A vector indicating the number of
          ground-truth labels for each example.
docstr_tok: ["Compute","the","specific","metric",".","To","be","implemented","separately","for","each","metric","class",".","Args",":","pred_isin_mat","(","torch.Tensor",")",":","A","boolean","matrix","whose",":","obj",":","`","(","i",",","k",")","`","element","indicates","if","the",":","obj",":","`","k","`","-th","prediction","for","the",":","obj",":","`","i","`","-th","example","is","correct","or","not",".","y_count","(","torch.Tensor",")",":","A","vector","indicating","the","number","of","ground-truth","labels","for","each","example","."]
code: def _compute(self, pred_isin_mat: Tensor, y_count: Tensor) -> Tensor:
      r"""Compute the specific metric.
      To be implemented separately for each metric class.
  
      Args:
          pred_isin_mat (torch.Tensor): A boolean matrix whose :obj:`(i,k)`
              element indicates if the :obj:`k`-th prediction for the
              :obj:`i`-th example is correct or not.
          y_count (torch.Tensor): A vector indicating the number of
              ground-truth labels for each example.
      """
      raise NotImplementedError
  
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 5 for calling the LinkPredMetric obj's underlying member method code with example usage: obj._compute(pred_isin_mat, y_count) without return types