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: Computes the final metric value.
docstr_tok: ["Computes","the","final","metric","value","."]
code: def compute(self) -> Tensor:
      r"""Computes the final metric value."""
      if self.total == 0:
          return torch.zeros_like(self.accum)
      return self.accum / self.total
  
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 3 for calling the LinkPredMetric obj's underlying member method code with example usage: obj.compute() and returns: unknown, torch