class_docstr: DWTFunction
class_docstr_tok: ["DWTFunction"]
code: def forward(ctx, x, w_ll, w_lh, w_hl, w_hh):
      x = x.contiguous()
      ctx.save_for_backward(w_ll, w_lh, w_hl, w_hh)
      ctx.shape = x.shape
  
      dim = x.shape[1]
  
      x_ll = torch.nn.functional.conv2d(
          x, w_ll.expand(dim, -1, -1, -1), stride=2, groups=dim
      )
      x_lh = torch.nn.functional.conv2d(
          x, w_lh.expand(dim, -1, -1, -1), stride=2, groups=dim
      )
      x_hl = torch.nn.functional.conv2d(
          x, w_hl.expand(dim, -1, -1, -1), stride=2, groups=dim
      )
      x_hh = torch.nn.functional.conv2d(
          x, w_hh.expand(dim, -1, -1, -1), stride=2, groups=dim
      )
      x = torch.cat([x_ll, x_lh, x_hl, x_hh], dim=1)
      return x
  
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 for calling the DWTFunction obj's underlying member method code with example usage: obj.forward(ctx, x, w_ll, w_lh, w_hl, w_hh) and returns: x