class_docstr: RoBERTa encoder.
class_docstr_tok: ["RoBERTa","encoder","."]
code: def __init__(self, args, dictionary):
      super().__init__(dictionary)
  
      # set any missing default values
      base_architecture(args)
      self.args = args
  
      if args.encoder_layers_to_keep:
          args.encoder_layers = len(
              args.encoder_layers_to_keep.split(",")
          )
  
      embed_tokens = self.build_embedding(
          len(dictionary), args.encoder_embed_dim, dictionary.pad()
      )
  
      self.sentence_encoder = self.build_encoder(
          args, dictionary, embed_tokens
      )
  
      self.lm_head = self.build_lm_head(
          embed_dim=args.encoder_embed_dim,
          output_dim=len(dictionary),
          activation_fn=args.activation_fn,
          weight=(
              self.sentence_encoder.embed_tokens.weight
              if not args.untie_weights_roberta
              else None
          ),
      )
  
imports: import logging
  import torch
  import torch.nn
  import torch.nn.functional
  from fairseq import utils
  from fairseq.models import FairseqEncoder, FairseqEncoderModel, register_model, register_model_architecture
  from fairseq.models.transformer import DEFAULT_MIN_PARAMS_TO_WRAP, TransformerEncoder
  from fairseq.modules import LayerNorm
  from fairseq.modules.quant_noise import quant_noise
  from fairseq.modules.transformer_sentence_encoder import init_bert_params
  from fairseq.utils import safe_getattr, safe_hasattr
  from .hub_interface import RobertaHubInterface
label_desc: Use image node_id 1 to create a new RobertaEncoder object from inherited base classes: FairseqEncoder with example: obj = RobertaEncoder(args, dictionary)