class_docstr: Modulated convolution.
  For details refer to [1]
  [1] Karras et. al. - Analyzing and Improving the Image Quality of StyleGAN (https://arxiv.org/abs/1912.04958)
class_docstr_tok: ["Modulated","convolution",".","For","details","refer","to","[","1","]","[","1","]","Karras","et",".","al",".","-","Analyzing","and","Improving","the","Image","Quality","of","StyleGAN","(","https",":","\/\/arxiv.org\/abs\/1912.04958",")"]
code: def forward(self, x, y):
      b, c, h, w = x.shape
  
      w1 = y[:, None, :, None, None]
      w2 = self.weight[None, :, :, :, :]
      weights = w2 * (w1 + 1)
  
      if self.demod:
          d = torch.rsqrt(
              (weights**2).sum(dim=(2, 3, 4), keepdim=True) + self.eps
          )
          weights = weights * d
  
      x = x.reshape(1, -1, h, w)
  
      _, _, *ws = weights.shape
      weights = weights.reshape(b * self.filters, *ws)
  
      padding = self._get_same_padding(
          h, self.kernel, self.dilation, self.stride
      )
      x = F.conv2d(x, weights, padding=padding, groups=b)
  
      x = x.reshape(-1, self.filters, h, w)
      return x
  
imports: import math
  from functools import partial
  from math import log2
  from typing import List
  import torch
  import torch.nn.functional
  from einops import rearrange
  from kornia.filters import filter2d
  from nemo.collections.tts.parts.utils.helpers import mask_sequence_tensor
label_desc: Use image node_id 3 for calling the Conv2DModulated obj's underlying member method code with example usage: obj.forward(x, y) and returns: x