class_docstr: HiFiC autoencoder architecture.
  
  This implements the HiFiC autoencoder as described in the following paper:
  
  High-Fidelity Generative Image Compression
  F. Mentzer, G. Toderici, M. Tschannen, E. Agustsson
  
  Args:
      in_channels: The number of channels in the input image.
      latent_features: The number of features to use as input to the
          conditional Gaussian layer.
      hyper_feautures: The number of features to use for the hyperprior.
      num_residual_blocks: Number of residual blocks to use at the start of
          generator decoding.
      freeze_encoder: Whether to freeze training of the encoder.
      freeze_bottleneck: Whether to freeze training of the bottleneck (both
          conditional Gaussian and hyperprior).
class_docstr_tok: ["HiFiC","autoencoder","architecture",".","This","implements","the","HiFiC","autoencoder","as","described","in","the","following","paper",":","High-Fidelity","Generative","Image","Compression","F.","Mentzer",",","G.","Toderici",",","M.","Tschannen",",","E.","Agustsson","Args",":","in_channels",":","The","number","of","channels","in","the","input","image",".","latent_features",":","The","number","of","features","to","use","as","input","to","the","conditional","Gaussian","layer",".","hyper_feautures",":","The","number","of","features","to","use","for","the","hyperprior",".","num_residual_blocks",":","Number","of","residual","blocks","to","use","at","the","start","of","generator","decoding",".","freeze_encoder",":","Whether","to","freeze","training","of","the","encoder",".","freeze_bottleneck",":","Whether","to","freeze","training","of","the","bottleneck","(","both","conditional","Gaussian","and","hyperprior",")","."]
code: def forward(self, image: Tensor) -> HyperpriorOutput:
      if not self.device_setting == "forward":
          raise RuntimeError(
              "Must call update_tensor_devices('forward') to use model forward."
          )
  
      # encode image to latent
      latent = self.encoder(image)
  
      # bottleneck processing
      hyper_latent = self.hyper_analysis(latent)
      hyper_latent, hyper_likelihoods = self.hyper_bottleneck(
          hyper_latent
      )
      with torch.no_grad():
          _, quantized_hyper_latent_likelihoods = self.hyper_bottleneck(
              hyper_latent, training=False
          )
      means = self.hyper_synthesis_mean(hyper_latent)
      scales = self.hyper_synthesis_scale(hyper_latent)
      quantized_latents, latent_likelihoods = self.latent_bottleneck(
          latent, scales, means=means
      )
      with torch.no_grad():
          _, quantized_latent_likelihoods = self.latent_bottleneck(
              latent, scales, means=means, training=False
          )
      if self.training:
          # we use straight-through to train the generator
          latent = self._ste_quantize(latent, means)
      else:
          # means we're in eval mode and the latents have been rounded
          latent = quantized_latents
  
      # reconstruct the image
      reconstruction = self.decoder(latent)
  
      return HyperpriorOutput(
          image=reconstruction,
          latent=latent,
          latent_likelihoods=latent_likelihoods,
          quantized_latent_likelihoods=quantized_latent_likelihoods.detach(),
          hyper_latent=hyper_latent,
          hyper_latent_likelihoods=hyper_likelihoods,
          quantized_hyper_latent_likelihoods=quantized_hyper_latent_likelihoods.detach(),
      )
  
imports: import logging
  import torch
  import torch.nn
  from compressai.entropy_models import EntropyBottleneck, GaussianConditional
  from torch import Tensor
  import neuralcompression.functional
  from neuralcompression import HyperpriorCompressedOutput, HyperpriorOutput
  from ._hific_encoder_decoder import HiFiCEncoder, HiFiCGenerator
  from ._hyperprior_autoencoder import HyperpriorAutoencoderBase
label_desc: Use image node_id 11 for calling the HiFiCAutoencoder obj's underlying member method code with example usage: obj.forward(image) and returns: HyperpriorOutput