code: def __init__(self, embed_dim: int, **kwargs):
      self.max_batch_size = kwargs.pop("max_batch_size", None)
      ddconfig = kwargs.pop("ddconfig")
      ckpt_path = kwargs.pop("ckpt_path", None)
      ckpt_engine = kwargs.pop("ckpt_engine", None)
      super().__init__(
          encoder_config={
              "target": "sgm.modules.diffusionmodules.model.Encoder",
              "params": ddconfig,
          },
          decoder_config={
              "target": "sgm.modules.diffusionmodules.model.Decoder",
              "params": ddconfig,
          },
          **kwargs,
      )
      self.quant_conv = torch.nn.Conv2d(
          (1 + ddconfig["double_z"]) * ddconfig["z_channels"],
          (1 + ddconfig["double_z"]) * embed_dim,
          1,
      )
      self.post_quant_conv = torch.nn.Conv2d(
          embed_dim, ddconfig["z_channels"], 1
      )
      self.embed_dim = embed_dim
  
      self.apply_ckpt(default(ckpt_path, ckpt_engine))
  
imports: import logging
  import math
  import re
  from abc import abstractmethod
  from contextlib import contextmanager
  from typing import Any, Dict, List, Optional, Tuple, Union
  import pytorch_lightning
  import torch
  import torch.nn
  from einops import rearrange
  from packaging import version
  from ..modules.autoencoding.regularizers import AbstractRegularizer
  from ..modules.ema import LitEma
  from ..util import default, get_nested_attribute, get_obj_from_str, instantiate_from_config
label_desc: Use image node_id 1 to create a new AutoencodingEngineLegacy object from inherited base classes: AutoencodingEngine with example: obj = AutoencodingEngineLegacy(embed_dim)