class_docstr: Takes a byte-pair representation of a batch of sentences
  (as produced by the ``OpenaiTransformerBytePairIndexer``)
  and generates a `ScalarMix` of the corresponding contextual embeddings.
  
  
  
  Parameters
  ----------
  transformer: ``OpenaiTransformer``, required.
      The ``OpenaiTransformer`` module used for the embeddings.
code: def __init__(self, transformer):
      super(OpenaiTransformerEmbedder, self).__init__()
  
      self._transformer = transformer
      self._scalar_mix = ScalarMix(
          transformer.num_output_layers, do_layer_norm=False
      )
  
file_path: magnitude/pymagnitude/third_party/allennlp/modules/token_embedders/openai_transformer_embedder.py
imports: from __future__ import absolute_import
  import torch
  from allennlp.modules.openai_transformer import OpenaiTransformer
  from allennlp.modules.scalar_mix import ScalarMix
  from allennlp.modules.token_embedders.token_embedder import TokenEmbedder
  from allennlp.nn.util import get_range_vector, get_device_of
label_desc: Use image node_id 1 to create a new OpenaiTransformerEmbedder object from inherited base classes: TokenEmbedder with example: obj = OpenaiTransformerEmbedder(transformer)