docstr: Getting the scores of the masked positions.
  
  Parameters
  ----------
  inputs
      - layout = 'NT'
          Shape (batch_size, seq_length)
      - layout = 'TN'
          Shape (seq_length, batch_size)
  
  valid_length
      The valid length of each sequence
      Shape (batch_size,)
  masked_positions
      The masked position of the sequence
      Shape (batch_size, num_masked_positions).
  
  Returns
  -------
  contextual_embedding
      - layout = 'NT'
          Shape (batch_size, seq_length, units).
      - layout = 'TN'
          Shape (seq_length, batch_size, units).
  
  pooled_out
      Shape (batch_size, units)
  mlm_scores :
      Shape (batch_size, num_masked_positions, vocab_size)
docstr_tok: ["Getting","the","scores","of","the","masked","positions",".","Parameters","--","--","--","--","--","inputs","-","layout","=","'NT'","Shape","(","batch_size",",","seq_length",")","-","layout","=","'TN'","Shape","(","seq_length",",","batch_size",")","valid_length","The","valid","length","of","each","sequence","Shape","(","batch_size",",",")","masked_positions","The","masked","position","of","the","sequence","Shape","(","batch_size",",","num_masked_positions",")",".","Returns","--","--","--","-","contextual_embedding","-","layout","=","'NT'","Shape","(","batch_size",",","seq_length",",","units",")",".","-","layout","=","'TN'","Shape","(","seq_length",",","batch_size",",","units",")",".","pooled_out","Shape","(","batch_size",",","units",")","mlm_scores",":","Shape","(","batch_size",",","num_masked_positions",",","vocab_size",")"]
code: def forward(self, inputs, valid_length, masked_positions):
      """Getting the scores of the masked positions.
  
      Parameters
      ----------
      inputs
          - layout = 'NT'
              Shape (batch_size, seq_length)
          - layout = 'TN'
              Shape (seq_length, batch_size)
  
      valid_length
          The valid length of each sequence
          Shape (batch_size,)
      masked_positions
          The masked position of the sequence
          Shape (batch_size, num_masked_positions).
  
      Returns
      -------
      contextual_embedding
          - layout = 'NT'
              Shape (batch_size, seq_length, units).
          - layout = 'TN'
              Shape (seq_length, batch_size, units).
  
      pooled_out
          Shape (batch_size, units)
      mlm_scores :
          Shape (batch_size, num_masked_positions, vocab_size)
      """
  
      all_encodings_outputs, pooled_out = self.backbone_model(
          inputs, valid_length
      )
      if self.backbone_model._output_all_encodings:
          contextual_embeddings = all_encodings_outputs[-1]
      else:
          contextual_embeddings = all_encodings_outputs
      if self.backbone_model.layout == "TN":
          contextual_embeddings = np.swapaxes(
              contextual_embeddings, 0, 1
          )
      mlm_features = select_vectors_by_position(
          contextual_embeddings, masked_positions
      )
      mlm_scores = self.mlm_decoder(mlm_features)
      return all_encodings_outputs, pooled_out, mlm_scores
  
imports: import os
  from typing import Tuple
  import mxnet
  from mxnet import use_np, np, npx
  from mxnet.gluon import HybridBlock, nn
  from .base import BACKBONE_REGISTRY
  from ..op import select_vectors_by_position
  from ..base import get_model_zoo_home_dir, get_repo_model_zoo_url, get_model_zoo_checksum_dir
  from ..layers import PositionalEmbedding, get_activation
  from ..utils.misc import download, load_checksum_stats
  from ..utils.registry import Registry
  from .transformer import TransformerEncoderLayer
  from ..initializer import TruncNorm
  from ..utils.config import CfgNode
  from ..attention_cell import gen_self_attn_mask
  from ..data.tokenizers import HuggingFaceByteBPETokenizer
label_desc: Use image node_id 2 for calling the RobertaForMLM obj's underlying member method code with example usage: obj.forward(inputs, valid_length, masked_positions) and returns: all_encodings_outputs,  pooled_out,  mlm_scores