code: def safe_load(fn: Union[Tensor, str]) -> Dict[str, Tensor]:
      t, json_len, metadata = safe_load_metadata(fn)
      ret = {}
      for k, v in metadata.items():
          if k == "__metadata__":
              continue
          dtype = safe_dtypes[v["dtype"]]
          sz = (
              v["data_offsets"][1] - v["data_offsets"][0]
          ) // dtype.itemsize
          ret[k] = (
              t[
                  8
                  + json_len
                  + v["data_offsets"][0] : 8
                  + json_len
                  + v["data_offsets"][0]
                  + sz
              ]
              .cast(dtype)
              .reshape(v["shape"])
          )
      return ret
  
file_path: tinygrad/tinygrad/nn/state.py
imports: import os, json, pathlib, zipfile, pickle, tarfile, struct
  from tqdm import tqdm
  from typing import Dict, Union, List, Optional, Any, Tuple
  from tinygrad.tensor import Tensor
  from tinygrad.ops import GlobalCounters
  from tinygrad.dtype import dtypes
  from tinygrad.helpers import prod, argsort, DEBUG, Timing, CI, unwrap
  from tinygrad.shape.view import strides_for_shape
  from tinygrad.features.multi import MultiLazyBuffer
  from collections import OrderedDict
label_desc: Use image node_id 2 for calling a global function with example usage: safe_load(fn) and returns: ret