class_docstr: TransformerEncoderLayer class.
  Args:
      d_model (int): dimension of model
      nhead (int): number of head
      dim_feedforward (int): dimension of feedforward
      dropout (float): dropout
      activation (str): activation
class_docstr_tok: ["TransformerEncoderLayer","class",".","Args",":","d_model","(","int",")",":","dimension","of","model","nhead","(","int",")",":","number","of","head","dim_feedforward","(","int",")",":","dimension","of","feedforward","dropout","(","float",")",":","dropout","activation","(","str",")",":","activation"]
code: def forward(
      self,
      src,
      src_mask: Optional[Tensor] = None,
      src_key_padding_mask: Optional[Tensor] = None,
      pos: Optional[Tensor] = None,
      num_zeros=None,
  ):
      src2 = self.norm1(src)
      q = k = self.with_pos_embed(src2, pos, num_zeros=num_zeros)
      src2 = self.self_attn(
          q,
          k,
          value=src2,
          attn_mask=src_mask,
          key_padding_mask=src_key_padding_mask,
      )[0]
      src = src + self.dropout1(src2)
      src2 = self.norm2(src)
      src2 = self.linear2(
          self.dropout(self.activation(self.linear1(src2)))
      )
      src = src + self.dropout2(src2)
      return src
  
imports: import copy
  import torch
  import torch.nn.functional
  from typing import Optional
  from torch import nn, Tensor
label_desc: Use image node_id 3 for calling the TransformerEncoderLayer obj's underlying member method code with example usage: obj.forward(src, src_mask, src_key_padding_mask, pos, num_zeros) and returns: src