class_docstr: Conditionally Parameterized Convolution
  
  Inspired by: https://github.com/tensorflow/tpu/blob/master/models/official/efficientnet/condconv/condconv_layers.py
  Grouped convolution hackery for parallel execution of the per-sample kernel filters inspired by this discussion:
  https://github.com/pytorch/pytorch/issues/17983
  
  Args:
      in_channels (`int`):
          Number of channels in the input image
      out_channels (`int`):
          Number of channels produced by the convolution.
      kernel_size (`int`):
          Size of the convolving kernel.
      stride (`int`):
          Stride of the convolution.
      padding (`str`):
          Padding added to all four sides of the input.
      dilation (`int`):
          Spacing between kernel elements.
      groups (`int`):
          Number of blocked connections from input channels to output channels.
      bias (`bool`):
          If True, adds a learnable bias to the output.
      num_experts (`int`):
          The number of expert kernels and biases.
code: def forward(
      self, x: torch.Tensor, routing_weights: torch.Tensor
  ) -> torch.Tensor:
      b, c, h, w = x.shape
      weight = torch.matmul(routing_weights, self.weight)
      new_weight_shape = (
          b * self.out_channels,
          self.in_channels // self.groups,
      ) + self.kernel_size
      weight = weight.view(new_weight_shape)
      bias = None
      if self.bias is not None:
          bias = torch.matmul(routing_weights, self.bias)
          bias = bias.view(b * self.out_channels)
      # move batch elements with channels so each batch element can be efficiently convolved with separate kernel
      x = x.view(1, b * c, h, w)
      if self.dynamic_padding:
          out = conv2d_same(
              x,
              weight,
              bias,
              stride=self.stride,
              padding=self.padding,
              dilation=self.dilation,
              groups=self.groups * b,
          )
      else:
          out = F.conv2d(
              x,
              weight,
              bias,
              stride=self.stride,
              padding=self.padding,
              dilation=self.dilation,
              groups=self.groups * b,
          )
      out = out.permute([1, 0, 2, 3]).view(
          b, self.out_channels, out.shape[-2], out.shape[-1]
      )
      return out
  
file_path: towhee/towhee/models/layers/cond_conv2d.py
imports: import math
  from typing import Callable, Tuple
  from functools import partial
  import numpy
  import torch
  from torch import nn
  from torch.nn import functional
  from towhee.models.utils.general_utils import to_2tuple
  from towhee.models.layers.conv2d_same import conv2d_same
  from towhee.models.layers.padding_functions import get_padding_value
label_desc: Use image node_id 3 for calling the CondConv2d obj's underlying member method code with example usage: obj.forward(x, routing_weights) and returns: out