code: def save_test_submission(
      self, input_dict: Dict, dir_path: str, mode: str
  ):
      assert "y_pred" in input_dict
      assert mode in ["test-whole", "test-dev", "test-challenge"]
  
      y_pred = input_dict["y_pred"]
  
      if mode == "test-whole":
          assert y_pred.shape == (146818,)
          filename = osp.join(dir_path, "y_pred_mag240m")
      elif mode == "test-dev":
          assert y_pred.shape == (88092,)
          filename = osp.join(dir_path, "y_pred_mag240m_test-dev")
      elif mode == "test-challenge":
          assert y_pred.shape == (58726,)
          filename = osp.join(dir_path, "y_pred_mag240m_test-challenge")
  
      makedirs(dir_path)
  
      if isinstance(y_pred, torch.Tensor):
          y_pred = y_pred.cpu().numpy()
  
      y_pred = y_pred.astype(np.short)
      np.savez_compressed(filename, y_pred=y_pred)
  
imports: from typing import Optional, Union, Dict
  import os
  import shutil
  import os.path
  import torch
  import numpy
  from ogb.utils.url import decide_download, download_url, extract_zip, makedirs
  from ogb.lsc.utils import split_test
label_desc: Use image node_id 2 for calling the MAG240MEvaluator obj's underlying member method code with example usage: obj.save_test_submission(input_dict, dir_path, mode) without return types