docstr: Returns object's configuration to config dictionary
docstr_tok: ["Returns","object","'s","configuration","to","config","dictionary"]
code: def to_config_dict(self) -> "DictConfig":
      """Returns object's configuration to config dictionary"""
      if hasattr(self, "_cfg") and self._cfg is not None:
          # Resolve the config dict
          if _HAS_HYDRA and isinstance(self._cfg, DictConfig):
              config = OmegaConf.to_container(self._cfg, resolve=True)
              config = OmegaConf.create(config)
              OmegaConf.set_struct(config, True)
  
              config = maybe_update_config_version(config)
  
          self._cfg = config
  
          return self._cfg
      else:
          raise NotImplementedError(
              "to_config_dict() can currently only return object._cfg but current object does not have it."
          )
  
imports: import hashlib
  import inspect
  import traceback
  from abc import ABC, abstractmethod
  from contextlib import contextmanager
  from dataclasses import dataclass, field
  from enum import Enum
  from functools import total_ordering
  from pathlib import Path
  from typing import Dict, Iterable, List, Optional, Tuple, Union
  import hydra
  import torch
  import wrapt
  from huggingface_hub import HfApi, HfFolder, ModelFilter, hf_hub_download
  from huggingface_hub.hf_api import ModelInfo
  from omegaconf import DictConfig, OmegaConf
  import nemo
  from nemo.core.connectors.save_restore_connector import SaveRestoreConnector
  from nemo.core.neural_types import NeuralType, NeuralTypeComparisonResult
  from nemo.utils import logging
  from nemo.utils.cloud import maybe_download_from_cloud
  from nemo.utils.data_utils import resolve_cache_dir
  from nemo.utils.model_utils import import_class_by_path, maybe_update_config_version
label_desc: Use image node_id 2 for calling the Serialization obj's underlying member method code with example usage: obj.to_config_dict() and returns: self