class_docstr: Dynamic Convolutional Module used in DMNet.
  
  Args:
      filter_size (int): The filter size of generated convolution kernel used in Dynamic Convolutional Module.
      fusion (bool): Add one conv to fuse DCM output feature.
      in_channels (int): Input channels.
      channels (int): Channels after modules, before conv_seg.
class_docstr_tok: ["Dynamic","Convolutional","Module","used","in","DMNet",".","Args",":","filter_size","(","int",")",":","The","filter","size","of","generated","convolution","kernel","used","in","Dynamic","Convolutional","Module",".","fusion","(","bool",")",":","Add","one","conv","to","fuse","DCM","output","feature",".","in_channels","(","int",")",":","Input","channels",".","channels","(","int",")",":","Channels","after","modules",",","before","conv_seg","."]
code: def forward(self, x):
      generated_filter = self.filter_gen_conv(self.avg_pool(x))
      x = self.input_redu_conv(x)
      b, c, h, w = x.shape
      assert (
          b > 0
      ), "The batch size of x need to be bigger than 0, but got {}.".format(
          b
      )
      x = paddle.unsqueeze(
          paddle.flatten(x, start_axis=0, stop_axis=1), axis=0
      )
      generated_filter = generated_filter.reshape(
          [b * c, 1, self.filter_size, self.filter_size]
      )
  
      x = F.pad(x, self.pad, mode="constant", value=0)
      output = F.conv2d(x, weight=generated_filter, groups=b * c)
      output = output.reshape([b, self.channels, h, w])
      output = self.norm(output)
      output = self.act(output)
      if self.fusion:
          output = self.fusion_conv(output)
      return output
  
file_path: PaddleSeg/paddleseg/models/dmnet.py
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.cvlibs import manager
  from paddleseg.models import layers
  from paddleseg.utils import utils
label_desc: Use image node_id 2 for calling the DCM obj's underlying member method code with example usage: obj.forward(x) and returns: output