class_docstr: Implementation of the Transformer Sentence Encoder. This directly makes
  use of the TransformerSentenceEncoder module in Fairseq.
  
  A few interesting config options:
      - encoder_normalize_before detemines whether the layer norm is applied
        before or after self_attention. This is similar to original
        implementation from Google.
      - activation_fn can be set to 'gelu' instead of the default of 'relu'.
      - project_representation adds a linear projection + tanh to the pooled output
        in the style of BERT.
code: def __init__(
      self,
      config: Config,
      output_encoded_layers: bool,
      padding_idx: int,
      vocab_size: int,
      *args,
      **kwarg,
  ) -> None:
      super().__init__(
          config,
          output_encoded_layers=output_encoded_layers,
          padding_idx=padding_idx,
          vocab_size=vocab_size,
      )
      self.sentence_encoder = SparseTransformerSentenceEncoderModule(
          padding_idx=padding_idx,
          vocab_size=vocab_size,
          num_encoder_layers=config.num_encoder_layers,
          embedding_dim=config.embedding_dim,
          ffn_embedding_dim=config.ffn_embedding_dim,
          num_attention_heads=config.num_attention_heads,
          dropout=config.dropout,
          attention_dropout=config.attention_dropout,
          activation_dropout=config.activation_dropout,
          max_seq_len=config.max_seq_len,
          num_segments=config.num_segments,
          use_position_embeddings=config.use_position_embeddings,
          offset_positions_by_padding=config.offset_positions_by_padding,
          encoder_normalize_before=config.encoder_normalize_before,
          apply_bert_init=config.apply_bert_init,
          activation_fn=config.activation_fn,
          freeze_embeddings=config.freeze_embeddings,
          n_trans_layers_to_freeze=config.n_trans_layers_to_freeze,
          export=self.export,
          is_bidirectional=config.is_bidirectional,
          stride=config.stride,
          expressivity=config.expressivity,
      )
      log_class_usage(__class__)
  
imports: from fairseq.modules.sparse_transformer_sentence_encoder import SparseTransformerSentenceEncoder
  from pytext.config import ConfigBase
  from pytext.models.representations.transformer_sentence_encoder import TransformerSentenceEncoder
  from pytext.utils.usage import log_class_usage
label_desc: Use image node_id 1 to create a new SparseTransformerSentenceEncoder object from inherited base classes: TransformerSentenceEncoder with example: obj = SparseTransformerSentenceEncoder(config, output_encoded_layers, padding_idx, vocab_size)