code: def _patch_mmcv():
      if PatchPyTorchModelIO.__patched_mmcv:
          return
      if "mmcv" not in sys.modules:
          return
      PatchPyTorchModelIO.__patched_mmcv = True
  
      # noinspection PyBroadException
      try:
          from mmcv.runner import epoch_based_runner, iter_based_runner
  
          # we don't want the recursion check here because it guards pytorch's patched save functions
          # which we need in order to log the saved model/checkpoint
          epoch_based_runner.save_checkpoint = (
              _patched_call_no_recursion_guard(
                  epoch_based_runner.save_checkpoint,
                  PatchPyTorchModelIO._mmcv_save_checkpoint,
              )
          )
          iter_based_runner.save_checkpoint = (
              _patched_call_no_recursion_guard(
                  iter_based_runner.save_checkpoint,
                  PatchPyTorchModelIO._mmcv_save_checkpoint,
              )
          )
      except Exception:
          pass
  
imports: import sys
  import six
  import threading
  from pathlib2 import Path
  from ...binding.frameworks.base_bind import PatchBaseModelIO
  from ..frameworks import _patched_call, _patched_call_no_recursion_guard, WeightsFileHandler, _Empty
  from ..import_bind import PostImportHookPatching
  from ...config import running_remotely
  from ...model import Framework
label_desc: Use image node_id 3 for calling the PatchPyTorchModelIO obj's underlying member method code with example usage: obj._patch_mmcv() without return types