class_docstr: IDWTFunction
class_docstr_tok: ["IDWTFunction"]
code: def backward(ctx, dx):
      if ctx.needs_input_grad[0]:
          filters = ctx.saved_tensors
          filters = filters[0]
          _, c, _, _ = ctx.shape
          c = c // 4
          dx = dx.contiguous()
  
          w_ll, w_lh, w_hl, w_hh = torch.unbind(filters, dim=0)
          x_ll = torch.nn.functional.conv2d(
              dx,
              w_ll.unsqueeze(1).expand(c, -1, -1, -1),
              stride=2,
              groups=c,
          )
          x_lh = torch.nn.functional.conv2d(
              dx,
              w_lh.unsqueeze(1).expand(c, -1, -1, -1),
              stride=2,
              groups=c,
          )
          x_hl = torch.nn.functional.conv2d(
              dx,
              w_hl.unsqueeze(1).expand(c, -1, -1, -1),
              stride=2,
              groups=c,
          )
          x_hh = torch.nn.functional.conv2d(
              dx,
              w_hh.unsqueeze(1).expand(c, -1, -1, -1),
              stride=2,
              groups=c,
          )
          dx = torch.cat([x_ll, x_lh, x_hl, x_hh], dim=1)
      return dx, None
  
imports: import torch
  from torch import nn
  from torch.autograd import Function
  import pywt
  from functools import partial
label_desc: Use image node_id 2 for calling the IDWTFunction obj's underlying member method code with example usage: obj.backward(ctx, dx) and returns: dx,  None