code: def __init__(
      self,
      n_layers,
      d_model,
      n_head,
      d_qkv,
      d_ff,
      ff_dropout,
      residual_dropout,
      attention_dropout,
      word_input_size,
      bias,
      morpho_emb_dropout,
      timing,
      encoder_max_len,
      activation=PartitionedReLU(),
  ):
      super().__init__()
      self.project_pretrained = nn.Linear(
          word_input_size, d_model // 2, bias=bias
      )
  
      self.pattention_morpho_emb_dropout = FeatureDropout(
          morpho_emb_dropout
      )
      if timing == "sin":
          self.add_timing = ConcatSinusoidalEncoding(
              d_model=d_model // 2, max_len=encoder_max_len
          )
      elif timing == "learned":
          self.add_timing = ConcatPositionalEncoding(
              d_model=d_model // 2, max_len=encoder_max_len
          )
      else:
          raise ValueError("Unhandled timing type: %s" % timing)
      self.transformer_input_norm = nn.LayerNorm(d_model)
      self.pattn_encoder = PartitionedTransformerEncoder(
          n_layers,
          d_model=d_model,
          n_head=n_head,
          d_qkv=d_qkv,
          d_ff=d_ff,
          ff_dropout=ff_dropout,
          residual_dropout=residual_dropout,
          attention_dropout=attention_dropout,
      )
  
imports: import copy
  import math
  import torch
  import torch.nn
  import torch.nn.functional
  from stanza.models.constituency.positional_encoding import ConcatSinusoidalEncoding
label_desc: Use image node_id 1 to create a new PartitionedTransformerModule object from inherited base classes: nn with example: obj = PartitionedTransformerModule(n_layers, d_model, n_head, d_qkv, d_ff, ff_dropout, residual_dropout, attention_dropout, word_input_size, bias, morpho_emb_dropout, timing, encoder_max_len, activation)