docstr:     Get candidate scores + embeddings associated with passed-in mention_bounds
  
  Input
      raw_ctxt_encoding: torch.FloatTensor (bsz, seqlen, embed_dim)
          shared embeddings straight from BERT
      mention_bounds: torch.IntTensor (bsz, max_num_pred_mentions, 2)
          top mention boundaries
  
  Returns
      torch.FloatTensor (bsz, max_num_pred_mentions, embed_dim)
docstr_tok: ["Get","candidate","scores","+","embeddings","associated","with","passed-in","mention_bounds","Input","raw_ctxt_encoding",":","torch.FloatTensor","(","bsz",",","seqlen",",","embed_dim",")","shared","embeddings","straight","from","BERT","mention_bounds",":","torch.IntTensor","(","bsz",",","max_num_pred_mentions",",","2",")","top","mention","boundaries","Returns","torch.FloatTensor","(","bsz",",","max_num_pred_mentions",",","embed_dim",")"]
code: def get_ctxt_embeds(
      self,
      raw_ctxt_encoding,
      mention_bounds,
  ):
      """
          Get candidate scores + embeddings associated with passed-in mention_bounds
  
      Input
          raw_ctxt_encoding: torch.FloatTensor (bsz, seqlen, embed_dim)
              shared embeddings straight from BERT
          mention_bounds: torch.IntTensor (bsz, max_num_pred_mentions, 2)
              top mention boundaries
  
      Returns
          torch.FloatTensor (bsz, max_num_pred_mentions, embed_dim)
      """
      # (bs, max_num_pred_mentions, embed_dim)
      embedding_ctxt = self.classification_heads["get_context_embeds"](
          raw_ctxt_encoding, mention_bounds
      )
      if self.linear_compression is not None:
          embedding_ctxt = self.linear_compression(embedding_ctxt)
      return embedding_ctxt
  
imports: import os
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from tqdm import tqdm
  from collections import OrderedDict
  from pytorch_transformers.modeling_bert import BertPreTrainedModel, BertConfig, BertModel
  from pytorch_transformers.tokenization_bert import BertTokenizer
  from elq.common.ranker_base import BertEncoder, get_model_obj
  from blink.common.optimizer import get_bert_optimizer
  from elq.biencoder.allennlp_span_utils import batched_span_select, batched_index_select
  from elq.biencoder.utils import batch_reshape_mask_left
label_desc: Use image node_id 5 for calling the BiEncoderModule obj's underlying member method code with example usage: obj.get_ctxt_embeds(raw_ctxt_encoding, mention_bounds) and returns: embedding_ctxt