code: def restore_forward(
      model: nn.Module, patch_attr: str = None
  ) -> nn.Module:
      """
      Restore original forward in model.
      """
      for module in model.modules():
          if hasattr(module, "orig_type"):
              # module has been patched; un-patch it
              module.__class__ = module.orig_type
      return model
  
imports: import collections.abc
  import logging
  import operator
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import torch
  import torch.nn
  from classy_vision.generic.util import eval_model, get_batchsize_per_replica, get_model_dummy_input, is_leaf, is_on_gpu
  from torch.cuda import cudart
label_desc: Use image node_id 8 for calling a global function with example usage: restore_forward(model, patch_attr) and returns: model