class_docstr: Trident Convolution Module.
  
  Args:
      in_channels (int): Number of channels in input.
      out_channels (int): Number of channels in output.
      kernel_size (int): Size of convolution kernel.
      stride (int, optional): Convolution stride. Default: 1.
      trident_dilations (tuple[int, int, int], optional): Dilations of
          different trident branch. Default: (1, 2, 3).
      test_branch_idx (int, optional): In inference, all 3 branches will
          be used if `test_branch_idx==-1`, otherwise only branch with
          index `test_branch_idx` will be used. Default: 1.
      bias (bool, optional): Whether to use bias in convolution or not.
          Default: False.
class_docstr_tok: ["Trident","Convolution","Module",".","Args",":","in_channels","(","int",")",":","Number","of","channels","in","input",".","out_channels","(","int",")",":","Number","of","channels","in","output",".","kernel_size","(","int",")",":","Size","of","convolution","kernel",".","stride","(","int",",","optional",")",":","Convolution","stride",".","Default",":","1.","trident_dilations","(","tuple","[","int",",","int",",","int","]",",","optional",")",":","Dilations","of","different","trident","branch",".","Default",":","(","1",",","2",",","3",")",".","test_branch_idx","(","int",",","optional",")",":","In","inference",",","all","3","branches","will","be","used","if","`","test_branch_idx==-1","`",",","otherwise","only","branch","with","index","`","test_branch_idx","`","will","be","used",".","Default",":","1.","bias","(","bool",",","optional",")",":","Whether","to","use","bias","in","convolution","or","not",".","Default",":","False","."]
code: def __init__(
      self,
      in_channels,
      out_channels,
      kernel_size,
      stride=1,
      trident_dilations=(1, 2, 3),
      test_branch_idx=1,
      bias=False,
  ):
      super(TridentConv, self).__init__()
      self.num_branch = len(trident_dilations)
      self.with_bias = bias
      self.test_branch_idx = test_branch_idx
      self.stride = _pair(stride)
      self.kernel_size = _pair(kernel_size)
      self.paddings = _pair(trident_dilations)
      self.dilations = trident_dilations
      self.in_channels = in_channels
      self.out_channels = out_channels
      self.bias = bias
  
      self.weight = nn.Parameter(
          torch.Tensor(out_channels, in_channels, *self.kernel_size)
      )
      if bias:
          self.bias = nn.Parameter(torch.Tensor(out_channels))
      else:
          self.bias = None
      self.init_weights()
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  import torch.utils.checkpoint
  from mmcv.cnn import build_conv_layer, build_norm_layer, kaiming_init
  from torch.nn.modules.utils import _pair
  from mmdet.models.backbones.resnet import Bottleneck, ResNet
  from mmdet.models.builder import BACKBONES
label_desc: Use image node_id 1 to create a new TridentConv object from inherited base classes: nn with example: obj = TridentConv(in_channels, out_channels, kernel_size, stride, trident_dilations, test_branch_idx, bias)