code: def _convert_others(
      d: tensor_dict_type, md: tensor_dict_type
  ) -> tensor_dict_type:
      nd = {}
      d, md = map(shallow_copy_dict, [d, md])
      keys = list(d.keys())
      m_keys = list(md.keys())
      for k in reversed(keys):
          if k == "model_ema.decay":
              keys.remove(k)
          elif not k.startswith("model") and not k.startswith(
              "model_ema"
          ):
              keys.remove(k)
      for mk in reversed(m_keys):
          if not mk.startswith("unet") and not mk.startswith(
              "unet_ema"
          ):
              continue
      keys.remove("model_ema.num_updates")
      keys.append("model_ema.num_updates")
      for k, mk in zip(keys, m_keys):
          v = d[k]
          mv = md[mk]
          assert (
              v.shape == mv.shape
          ), f"{k} ({v.shape}) != {mk} ({mv.shape})"
          nd[mk] = v
          key_mapping_inv[mk] = k
      return nd
  
imports: import json
  import torch
  from torch import Tensor
  from typing import Dict
  from typing import List
  from typing import Union
  from typing import Optional
  from cftool.misc import shallow_copy_dict
  from cftool.array import tensor_dict_type
  from ..misc.toolkit import get_tensors
  from ..misc.toolkit import download_static
  from ..api.cv.diffusion import DiffusionAPI
label_desc: Use image node_id 3 for calling a global function with example usage: _convert_others(d, md) and returns: nd