class_docstr: VQ-VAE model from Paella model.
  
  This model inherits from [`ModelMixin`]. Check the superclass documentation for the generic methods the library
  implements for all the model (such as downloading or saving, etc.)
  
  Parameters:
      in_channels (int, *optional*, defaults to 3): Number of channels in the input image.
      out_channels (int,  *optional*, defaults to 3): Number of channels in the output.
      up_down_scale_factor (int, *optional*, defaults to 2): Up and Downscale factor of the input image.
      levels  (int, *optional*, defaults to 2): Number of levels in the model.
      bottleneck_blocks (int, *optional*, defaults to 12): Number of bottleneck blocks in the model.
      embed_dim (int, *optional*, defaults to 384): Number of hidden channels in the model.
      latent_channels (int, *optional*, defaults to 4): Number of latent channels in the VQ-VAE model.
      num_vq_embeddings (int, *optional*, defaults to 8192): Number of codebook vectors in the VQ-VAE.
      scale_factor (float, *optional*, defaults to 0.3764): Scaling factor of the latent space.
class_docstr_tok: ["VQ-VAE","model","from","Paella","model",".","This","model","inherits","from","[","`","ModelMixin","`","]",".","Check","the","superclass","documentation","for","the","generic","methods","the","library","implements","for","all","the","model","(","such","as","downloading","or","saving",",","etc",".",")","Parameters",":","in_channels","(","int",",","*","optional","*",",","defaults","to","3",")",":","Number","of","channels","in","the","input","image",".","out_channels","(","int",",","*","optional","*",",","defaults","to","3",")",":","Number","of","channels","in","the","output",".","up_down_scale_factor","(","int",",","*","optional","*",",","defaults","to","2",")",":","Up","and","Downscale","factor","of","the","input","image",".","levels","(","int",",","*","optional","*",",","defaults","to","2",")",":","Number","of","levels","in","the","model",".","bottleneck_blocks","(","int",",","*","optional","*",",","defaults","to","12",")",":","Number","of","bottleneck","blocks","in","the","model",".","embed_dim","(","int",",","*","optional","*",",","defaults","to","384",")",":","Number","of","hidden","channels","in","the","model",".","latent_channels","(","int",",","*","optional","*",",","defaults","to","4",")",":","Number","of","latent","channels","in","the","VQ-VAE","model",".","num_vq_embeddings","(","int",",","*","optional","*",",","defaults","to","8192",")",":","Number","of","codebook","vectors","in","the","VQ-VAE",".","scale_factor","(","float",",","*","optional","*",",","defaults","to","0.3764",")",":","Scaling","factor","of","the","latent","space","."]
docstr: Args:
      sample (`torch.FloatTensor`): Input sample.
      return_dict (`bool`, *optional*, defaults to `True`):
          Whether or not to return a [`DecoderOutput`] instead of a plain tuple.
docstr_tok: ["Args",":","sample","(","`","torch.FloatTensor","`",")",":","Input","sample",".","return_dict","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","or","not","to","return","a","[","`","DecoderOutput","`","]","instead","of","a","plain","tuple","."]
code: def forward(
      self, sample: torch.FloatTensor, return_dict: bool = True
  ) -> Union[DecoderOutput, torch.FloatTensor]:
      r"""
      Args:
          sample (`torch.FloatTensor`): Input sample.
          return_dict (`bool`, *optional*, defaults to `True`):
              Whether or not to return a [`DecoderOutput`] instead of a plain tuple.
      """
      x = sample
      h = self.encode(x).latents
      dec = self.decode(h).sample
  
      if not return_dict:
          return (dec,)
  
      return DecoderOutput(sample=dec)
  
file_path: diffusers/src/diffusers/pipelines/wuerstchen/modeling_paella_vq_model.py
imports: from typing import Union
  import torch
  import torch.nn
  from ...configuration_utils import ConfigMixin, register_to_config
  from ...models.autoencoders.vae import DecoderOutput, VectorQuantizer
  from ...models.modeling_utils import ModelMixin
  from ...models.vq_model import VQEncoderOutput
  from ...utils.accelerate_utils import apply_forward_hook
label_desc: Use image node_id 4 for calling the PaellaVQModel obj's underlying member method code with example usage: obj.forward(sample, return_dict) and returns: DecoderOutput, dec