class_docstr: standard transformer encoder
  
  Example:
      >>> import torch
      >>> from towhee.models.layers.transformer_encoder import TransformerEncoder
      >>>
      >>> dummpy_x = torch.rand(2, 4)
      >>> mode = TransformerEncoder(d_model=4, n_head=1, dim_ff=1, dropout=0.0, num_layers=1, num_frames=2)
      >>> out = mode(dummy_x)
      >>> print(out.shape)
      torch.Size([2, 2, 4])
class_docstr_tok: ["standard","transformer","encoder","Example",":",">",">",">","import","torch",">",">",">","from","towhee.models.layers.transformer_encoder","import","TransformerEncoder",">",">",">",">",">",">","dummpy_x","=","torch.rand","(","2",",","4",")",">",">",">","mode","=","TransformerEncoder","(","d_model=4",",","n_head=1",",","dim_ff=1",",","dropout=0.0",",","num_layers=1",",","num_frames=2",")",">",">",">","out","=","mode","(","dummy_x",")",">",">",">","print","(","out.shape",")","torch.Size","(","[","2",",","2",",","4","]",")"]
code: def forward(self, src):
      src = self.pos_embed(src)
      e_op = self.transformer_encoder(src)
      return e_op
  
imports: from torch import nn
  from towhee.models.layers.position_encoding import PositionEmbedding
label_desc: Use image node_id 2 for calling the TransformerEncoder obj's underlying member method code with example usage: obj.forward(src) and returns: e_op