original_docstring: Build projection layer for key/query/value/out.
docstring: Build projection layer for key/query/value/out.
docstring_tokens: Build projection layer for key / query / value / out .
code: def build_project(self, in_channels, channels, num_convs, use_conv_module,
                        conv_cfg, norm_cfg, act_cfg):
          """Build projection layer for key/query/value/out."""
          if use_conv_module:
              convs = [
                  ConvModule(
                      in_channels,
                      channels,
                      1,
                      conv_cfg=conv_cfg,
                      norm_cfg=norm_cfg,
                      act_cfg=act_cfg)
              ]
              for _ in range(num_convs - 1):
                  convs.append(
                      ConvModule(
                          channels,
                          channels,
                          1,
                          conv_cfg=conv_cfg,
                          norm_cfg=norm_cfg,
                          act_cfg=act_cfg))
          else:
              convs = [nn.Conv2d(in_channels, channels, 1)]
              for _ in range(num_convs - 1):
                  convs.append(nn.Conv2d(channels, channels, 1))
          if len(convs) > 1:
              convs = nn.Sequential(*convs)
          else:
              convs = convs[0]
          return convs
code_tokens: def build_project ( self , in_channels , channels , num_convs , use_conv_module , conv_cfg , norm_cfg , act_cfg ) : if use_conv_module : convs = [ ConvModule ( in_channels , channels , 1 , conv_cfg = conv_cfg , norm_cfg = norm_cfg , act_cfg = act_cfg ) ] for _ in range ( num_convs - 1 ) : convs . append ( ConvModule ( channels , channels , 1 , conv_cfg = conv_cfg , norm_cfg = norm_cfg , act_cfg = act_cfg ) ) else : convs = [ nn . Conv2d ( in_channels , channels , 1 ) ] for _ in range ( num_convs - 1 ) : convs . append ( nn . Conv2d ( channels , channels , 1 ) ) if len ( convs ) > 1 : convs = nn . Sequential ( * convs ) else : convs = convs [ 0 ] return convs
short_docstring: Build projection layer for key/query/value/out.
short_docstring_tokens: Build projection layer for key / query / value / out .
comment: """Build projection layer for key/query/value/out."""