class_docstr: DWT2D
class_docstr_tok: ["DWT2D"]
code: def __init__(self, wave):
      super().__init__()
      w = pywt.Wavelet(wave)
      dec_hi = torch.Tensor(w.dec_hi[::-1])
      dec_lo = torch.Tensor(w.dec_lo[::-1])
  
      w_ll = dec_lo.unsqueeze(0) * dec_lo.unsqueeze(1)
      w_lh = dec_lo.unsqueeze(0) * dec_hi.unsqueeze(1)
      w_hl = dec_hi.unsqueeze(0) * dec_lo.unsqueeze(1)
      w_hh = dec_hi.unsqueeze(0) * dec_hi.unsqueeze(1)
  
      self.register_buffer("w_ll", w_ll.unsqueeze(0).unsqueeze(0))
      self.register_buffer("w_lh", w_lh.unsqueeze(0).unsqueeze(0))
      self.register_buffer("w_hl", w_hl.unsqueeze(0).unsqueeze(0))
      self.register_buffer("w_hh", w_hh.unsqueeze(0).unsqueeze(0))
  
      self.w_ll = self.w_ll.to(dtype=torch.float16)
      self.w_lh = self.w_lh.to(dtype=torch.float16)
      self.w_hl = self.w_hl.to(dtype=torch.float16)
      self.w_hh = self.w_hh.to(dtype=torch.float16)
  
imports: import torch
  from torch import nn
  from torch.autograd import Function
  import pywt
  from functools import partial
label_desc: Use image node_id 1 to create a new DWT2D object from inherited base classes: nn with example: obj = DWT2D(wave)