class_docstr: Base class for hierarchical latent variable models.
  
  We assume that the model is of the form
  
  z_{steps-1} -> z_{steps-2} -> ... -> z_0 -> data,
  
  where
  
  1) all variables have the same dims [batch-size, channels, height, width],
  2) p(z_{step}|z_{step+1}), q(z_{step}|z_{step+1}, data), q(z_{steps-1}|data)
      are Gaussians with diagonal covariance matrix,
  3) p(z_{steps-1}) is a standard normal.
  
  Args:
      steps: The number of steps/hierarchchies.
class_docstr_tok: ["Base","class","for","hierarchical","latent","variable","models",".","We","assume","that","the","model","is","of","the","form","z_","{","steps-1","}","-",">","z_","{","steps-2","}","-",">","...","-",">","z_0","-",">","data",",","where","1",")","all","variables","have","the","same","dims","[","batch-size",",","channels",",","height",",","width","]",",","2",")","p","(","z_","{","step","}","|z_","{","step+1","}",")",",","q","(","z_","{","step","}","|z_","{","step+1","}",",","data",")",",","q","(","z_","{","steps-1","}","|data",")","are","Gaussians","with","diagonal","covariance","matrix",",","3",")","p","(","z_","{","steps-1","}",")","is","a","standard","normal",".","Args",":","steps",":","The","number","of","steps\/hierarchchies","."]
docstr: Outputs the mean and standard deviation of the Gaussian
  posterior q(z_{steps-1}|data).
  
  Args:
      data: The input data array.
  Returns:
      The parameters (mean and stdd) of the Gaussian posterior.
docstr_tok: ["Outputs","the","mean","and","standard","deviation","of","the","Gaussian","posterior","q","(","z_","{","steps-1","}","|data",")",".","Args",":","data",":","The","input","data","array",".","Returns",":","The","parameters","(","mean","and","stdd",")","of","the","Gaussian","posterior","."]
code: def infer_fn(self, data: np.ndarray) -> GaussianParams:
      """
      Outputs the mean and standard deviation of the Gaussian
      posterior q(z_{steps-1}|data).
  
      Args:
          data: The input data array.
      Returns:
          The parameters (mean and stdd) of the Gaussian posterior.
      """
  
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 2 for calling the BaseHLVModel obj's underlying member method code with example usage: obj.infer_fn(data) without return types