docstr: Format of input_dict:
  - 'h,r->t'
      - t_pred_top10: np.ndarray of shape (num_eval_triplets, 10)
          (i,j) represents the j-th prediction for i-th triplet
          Only top10 prediction is taken into account
      - t: np.ndarray of shape (num_eval_triplets,)
docstr_tok: ["Format","of","input_dict",":","-","'","h",",","r-",">","t'","-","t_pred_top10",":","np.ndarray","of","shape","(","num_eval_triplets",",","10",")","(","i",",","j",")","represents","the","j-th","prediction","for","i-th","triplet","Only","top10","prediction","is","taken","into","account","-","t",":","np.ndarray","of","shape","(","num_eval_triplets",",",")"]
code: def eval(self, input_dict):
      """
      Format of input_dict:
      - 'h,r->t'
          - t_pred_top10: np.ndarray of shape (num_eval_triplets, 10)
              (i,j) represents the j-th prediction for i-th triplet
              Only top10 prediction is taken into account
          - t: np.ndarray of shape (num_eval_triplets,)
  
      """
      assert "h,r->t" in input_dict
      assert ("t_pred_top10" in input_dict["h,r->t"]) and (
          "t" in input_dict["h,r->t"]
      )
  
      # h,r->t
      t_pred_top10 = input_dict["h,r->t"]["t_pred_top10"]
      t = input_dict["h,r->t"]["t"]
      if not isinstance(t_pred_top10, torch.Tensor):
          t_pred_top10 = torch.from_numpy(t_pred_top10)
      if not isinstance(t, torch.Tensor):
          t = torch.from_numpy(t)
  
      assert t_pred_top10.shape[1] == 10 and len(t_pred_top10) == len(t)
  
      # verifying that there is no duplicated prediction for each triplet
      duplicated = False
      for i in range(len(t_pred_top10)):
          if len(
              torch.unique(t_pred_top10[i][t_pred_top10[i] >= 0])
          ) != len(t_pred_top10[i][t_pred_top10[i] >= 0]):
              duplicated = True
              break
  
      if duplicated:
          print(
              "Found duplicated tail prediction for some triplets! MRR is automatically set to 0."
          )
          mrr = 0
      else:
          mrr = self._calculate_mrr(
              t.to(t_pred_top10.device), t_pred_top10
          )
  
      return {"mrr": mrr}
  
imports: from typing import Optional, Union, Dict
  import os
  import shutil
  import os.path
  import torch
  import numpy
  import pandas
  from ogb.utils.url import decide_download, download_url, extract_zip, makedirs
label_desc: Use image node_id 1 for calling the WikiKG90Mv2Evaluator obj's underlying member method code with example usage: obj.eval(input_dict) and returns: dict