class_docstr: Hierarchical latent variable model based on a diffusion model.
  
  Args:
      model: The model to use for the denoising (should be in eval mode).
      diffusion: The diffusion to sample from.
      use_log_variance: Whether to use the (clipped) log variance.
      clip_denoised: If True, clip the denoised signal.
      device: The device to use.
          Defaults to the device of the first model parameter.
class_docstr_tok: ["Hierarchical","latent","variable","model","based","on","a","diffusion","model",".","Args",":","model",":","The","model","to","use","for","the","denoising","(","should","be","in","eval","mode",")",".","diffusion",":","The","diffusion","to","sample","from",".","use_log_variance",":","Whether","to","use","the","(","clipped",")","log","variance",".","clip_denoised",":","If","True",",","clip","the","denoised","signal",".","device",":","The","device","to","use",".","Defaults","to","the","device","of","the","first","model","parameter","."]
code: def __init__(
      self,
      model: torch.nn.Module,
      diffusion: GaussianDiffusion,
      use_log_variance: bool = False,
      clip_denoised: bool = True,
      device: Union[torch.device, str, None] = None,
  ):
      self.model = model
      self.diffusion = diffusion
      self.use_log_variance = use_log_variance
      self.clip_denoised = clip_denoised
      self.device = device
      if self.device is None:
          self.device = next(model.parameters()).device
      super().__init__(steps=self.diffusion.num_timesteps)
  
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 1 to create a new DiffusionModel object from inherited base classes: BaseHLVModel with example: obj = DiffusionModel(model, diffusion, use_log_variance, clip_denoised, device)