class_docstr: Lossless compression for Herarchical latent variable models.
  
  Based on the Craystack (https://github.com/j-towns/craystack)
  implementation of Bits-Back coding.
  
  Args:
      model: The hierarchical latent variable model.
      data_shape: The shape [batch-size, channels, height, width]
          of the data and each latent.
      latent_prec: Coding precision.
      prior_prec: Precision for the discretization.
      obs_prec: Precision for the observation codec.
      data_prec: Precision of the discrete data.
      initial_len: Length of the random initial bitstring.
      data_min: Minimum value of the data to be fed into the model.
      data_max: Maximum value of the data to be fed into the model.
      clip_stdd: Minimum value for the stdd of the observation codec.
      track: Whether to track the message sizes at each step.
class_docstr_tok: ["Lossless","compression","for","Herarchical","latent","variable","models",".","Based","on","the","Craystack","(","https",":","\/\/github.com\/j-towns\/craystack",")","implementation","of","Bits-Back","coding",".","Args",":","model",":","The","hierarchical","latent","variable","model",".","data_shape",":","The","shape","[","batch-size",",","channels",",","height",",","width","]","of","the","data","and","each","latent",".","latent_prec",":","Coding","precision",".","prior_prec",":","Precision","for","the","discretization",".","obs_prec",":","Precision","for","the","observation","codec",".","data_prec",":","Precision","of","the","discrete","data",".","initial_len",":","Length","of","the","random","initial","bitstring",".","data_min",":","Minimum","value","of","the","data","to","be","fed","into","the","model",".","data_max",":","Maximum","value","of","the","data","to","be","fed","into","the","model",".","clip_stdd",":","Minimum","value","for","the","stdd","of","the","observation","codec",".","track",":","Whether","to","track","the","message","sizes","at","each","step","."]
docstr: Craystack codec for the posterior.
  
  Args:
      post_params: The parameters (mean and standard deviation)
          of the Gaussian posterior.
      prior_params: The parameters (mean and standard deviation)
          of the Gaussian prior.
  Returns:
      The craystack codec for the Gaussian posterior
      (discretized according to the Gaussian prior).
docstr_tok: ["Craystack","codec","for","the","posterior",".","Args",":","post_params",":","The","parameters","(","mean","and","standard","deviation",")","of","the","Gaussian","posterior",".","prior_params",":","The","parameters","(","mean","and","standard","deviation",")","of","the","Gaussian","prior",".","Returns",":","The","craystack","codec","for","the","Gaussian","posterior","(","discretized","according","to","the","Gaussian","prior",")","."]
code: def _post_codec(
      self, post_params: GaussianParams, prior_params: GaussianParams
  ) -> cs.Codec:
      """
      Craystack codec for the posterior.
  
      Args:
          post_params: The parameters (mean and standard deviation)
              of the Gaussian posterior.
          prior_params: The parameters (mean and standard deviation)
              of the Gaussian prior.
      Returns:
          The craystack codec for the Gaussian posterior
          (discretized according to the Gaussian prior).
      """
      return cs.DiagGaussian_GaussianBins(
          post_params.mean,
          post_params.stdd,
          prior_params.mean,
          prior_params.stdd,
          self.latent_prec,
          self.prior_prec,
      )
  
imports: from abc import ABC, abstractmethod
  from typing import List, NamedTuple, Optional, Tuple, Union, overload
  import craystack
  import numpy
  import torch
  from craystack import codecs
  from craystack.bb_ans import BBANS
  from improved_diffusion.gaussian_diffusion import GaussianDiffusion
label_desc: Use image node_id 9 for calling the BitsBackCodec obj's underlying member method code with example usage: obj._post_codec(post_params, prior_params) and returns: cs