code: def make_trident_res_layer(
      block,
      inplanes,
      planes,
      num_blocks,
      stride=1,
      trident_dilations=(1, 2, 3),
      style="pytorch",
      with_cp=False,
      conv_cfg=None,
      norm_cfg=dict(type="BN"),
      dcn=None,
      plugins=None,
      test_branch_idx=-1,
  ):
      """Build Trident Res Layers."""
  
      downsample = None
      if stride != 1 or inplanes != planes * block.expansion:
          downsample = []
          conv_stride = stride
          downsample.extend(
              [
                  build_conv_layer(
                      conv_cfg,
                      inplanes,
                      planes * block.expansion,
                      kernel_size=1,
                      stride=conv_stride,
                      bias=False,
                  ),
                  build_norm_layer(norm_cfg, planes * block.expansion)[
                      1
                  ],
              ]
          )
          downsample = nn.Sequential(*downsample)
  
      layers = []
      for i in range(num_blocks):
          layers.append(
              block(
                  inplanes=inplanes,
                  planes=planes,
                  stride=stride if i == 0 else 1,
                  trident_dilations=trident_dilations,
                  downsample=downsample if i == 0 else None,
                  style=style,
                  with_cp=with_cp,
                  conv_cfg=conv_cfg,
                  norm_cfg=norm_cfg,
                  dcn=dcn,
                  plugins=plugins,
                  test_branch_idx=test_branch_idx,
                  concat_output=True if i == num_blocks - 1 else False,
              )
          )
          inplanes = planes * block.expansion
      return nn.Sequential(*layers)
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  import torch.utils.checkpoint
  from mmcv.cnn import build_conv_layer, build_norm_layer
  from mmengine.model import BaseModule
  from torch.nn.modules.utils import _pair
  from mmdet.models.backbones.resnet import Bottleneck, ResNet
  from mmdet.registry import MODELS
label_desc: Use image node_id 1 for calling a global function with example usage: make_trident_res_layer(block, inplanes, planes, num_blocks, stride, trident_dilations, style, with_cp, conv_cfg, norm_cfg, dcn, plugins, test_branch_idx) and returns: nn