class_docstr: Dynamic Convolution.
class_docstr_tok: ["Dynamic","Convolution","."]
code: def forward(self, inputs: dict) -> dict:
      visual_feats = inputs["visual"]
  
      out_vis_feats = []
      for level, feature in enumerate(visual_feats):
          offset_conv_args = {}
          if self.offset is not None:
              offset_mask = self.offset(feature)
              offset = offset_mask[:, :18, :, :]
              mask = offset_mask[:, 18:, :, :].sigmoid()
              offset_conv_args = dict(offset=offset, mask=mask)
  
          temp_feats = [self.dyconvs[1](feature, **offset_conv_args)]
  
          if level > 0:
              temp_feats.append(
                  self.dyconvs[2](
                      visual_feats[level - 1], **offset_conv_args
                  )
              )
          if level < len(visual_feats) - 1:
              temp_feats.append(
                  F.upsample_bilinear(
                      self.dyconvs[0](
                          visual_feats[level + 1], **offset_conv_args
                      ),
                      size=[feature.size(2), feature.size(3)],
                  )
              )
          mean_feats = torch.mean(
              torch.stack(temp_feats), dim=0, keepdim=False
          )
  
          if self.attnconv is not None:
              attn_feat = []
              res_feat = []
              for feat in temp_feats:
                  res_feat.append(feat)
                  attn_feat.append(self.attnconv(feat))
  
              res_feat = torch.stack(res_feat)
              spa_pyr_attn = self.h_sigmoid(torch.stack(attn_feat))
  
              mean_feats = torch.mean(
                  res_feat * spa_pyr_attn, dim=0, keepdim=False
              )
  
          out_vis_feats.append(mean_feats)
  
      out_vis_feats = [self.relu(item) for item in out_vis_feats]
  
      features_dict = {"visual": out_vis_feats, "lang": inputs["lang"]}
  
      return features_dict
  
imports: import copy
  import math
  from typing import Callable, List, Optional, Sequence, Tuple, Union
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import Scale
  from mmcv.ops.modulated_deform_conv import ModulatedDeformConv2d
  from mmengine.config import ConfigDict
  from mmengine.model import BaseModel
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.structures.bbox import cat_boxes
  from mmdet.utils import InstanceList, OptInstanceList, reduce_mean
  from ..utils import BertEncoderLayer, VLFuse, filter_scores_and_topk, permute_and_flatten, select_single_mlvl, unpack_gt_instances
  from ..utils.vlfuse_helper import MAX_CLAMP_VALUE
  from .atss_head import ATSSHead
label_desc: Use image node_id 3 for calling the DyConv obj's underlying member method code with example usage: obj.forward(inputs) and returns: features_dict