code: def serialize_model(model):
      args, kwargs = model._init_args_kwargs
      state = copy_state(model.state_dict())
      return {
          "class": model.__class__,
          "args": args,
          "kwargs": kwargs,
          "state": state,
      }
  
file_path: fairseq/examples/speech_synthesis/preprocessing/denoiser/utils.py
imports: import functools
  import logging
  from contextlib import contextmanager
  import inspect
  import time
label_desc: Use image node_id 4 for calling a global function with example usage: serialize_model(model) and returns: dict