code: def __init__(self, sde):
      super(SDELogqp, self).__init__(
          noise_type=sde.noise_type, sde_type=sde.sde_type
      )
      self._base_sde = sde
  
      # Make this redirection a one-time cost.
      try:
          self._base_f = sde.f
          self._base_g = sde.g
          self._base_h = sde.h
      except AttributeError as e:
          # TODO: relax this requirement, and use f_and_g, f_and_g_prod, f_and_g_and_h and f_and_g_prod_and_h if
          #  they're available.
          raise AttributeError(
              "If using logqp then drift, diffusion and prior drift must all be specified."
          ) from e
  
      # Make this method selection a one-time cost.
      if sde.noise_type == NOISE_TYPES.diagonal:
          self.f = self.f_diagonal
          self.g = self.g_diagonal
          self.f_and_g = self.f_and_g_diagonal
      else:
          self.f = self.f_general
          self.g = self.g_general
          self.f_and_g = self.f_and_g_general
  
imports: import abc
  import torch
  from torch import nn
  from .None import misc
  from ..settings import NOISE_TYPES, SDE_TYPES
  from ..types import Tensor
label_desc: Use image node_id 1 to create a new SDELogqp object from inherited base classes: BaseSDE with example: obj = SDELogqp(sde)