class_docstr: This is a TorchScriptable implementation of RoBERTa from fairseq
  for the purposes of creating a productionized RoBERTa model. It distills just
  the elements which are required to implement the RoBERTa model, and within that
  is restructured and rewritten to be able to be compiled by TorchScript for
  production use cases.
  
  This SentenceEncoder can load in the public RoBERTa weights directly with
  `load_roberta_state_dict`, which will translate the keys as they exist in
  the publicly released RoBERTa to the correct structure for this implementation.
  The default constructor value will have the same size and shape as that model.
  
  To use RoBERTa with this, download the RoBERTa public weights as `roberta.weights`
  
  >>> encoder = SentenceEncoder()
  >>> weights = torch.load("roberta.weights")
  >>> encoder.load_roberta_state_dict(weights)
  
  Within this you will still need to preprocess inputs using fairseq and the publicly
  released vocabs, and finally place this encoder in a model alongside say an MLP
  output layer to do classification.
code: def __init__(self, transformer: Optional[Transformer] = None):
      super().__init__()
      self.transformer = transformer or Transformer()
      log_class_usage(__class__)
  
imports: import re
  from typing import List, Optional
  import torch
  from pytext.utils.usage import log_class_usage
  from pytorch.text.fb.nn.modules.transformer import Transformer
  from torch import nn
label_desc: Use image node_id 1 to create a new SentenceEncoder object from inherited base classes: nn with example: obj = SentenceEncoder(transformer)