class_docstr: Aggregation module.
  
  Args:
      - clip_length (`int=0`):
          Dimension of CLIP features.
      - embed_dim (`int=2048`):
          Dimension used in Transformer encoder.
      - n_layers (`int=6`):
          Number of layers used in Transformer encoder.
class_docstr_tok: ["Aggregation","module",".","Args",":","-","clip_length","(","`","int=0","`",")",":","Dimension","of","CLIP","features",".","-","embed_dim","(","`","int=2048","`",")",":","Dimension","used","in","Transformer","encoder",".","-","n_layers","(","`","int=6","`",")",":","Number","of","layers","used","in","Transformer","encoder","."]
code: def __init__(
      self,
      clip_length: int = 0,
      embed_dim: int = 2048,
      n_layers: int = 6,
  ):
      super().__init__()
      self.clip_length = clip_length
      drop_rate = 0.0
      enc_layer = nn.TransformerEncoderLayer(d_model=embed_dim, nhead=8)
      self.transformer_enc = nn.TransformerEncoder(
          enc_layer, num_layers=n_layers, norm=nn.LayerNorm(embed_dim)
      )
  
      self.cls_token = nn.Parameter(torch.zeros(1, 1, embed_dim))
      self.pos_embed = nn.Parameter(
          torch.zeros(1, clip_length + 1, embed_dim)
      )
      self.pos_drop = nn.Dropout(p=drop_rate)
  
      with torch.no_grad():
          trunc_normal_(self.pos_embed, std=0.02)
          trunc_normal_(self.cls_token, std=0.02)
      self.apply(init_vit_weights)
  
imports: import torch
  from torch import nn
  from collections import OrderedDict
  from towhee.models.utils.weight_init import trunc_normal_
  from towhee.models.utils.init_vit_weights import init_vit_weights
label_desc: Use image node_id 1 to create a new TAggregate object from inherited base classes: nn with example: obj = TAggregate(clip_length, embed_dim, n_layers)