class_docstr: Example encoder, consisting of an embedding layer and a 1-layer LSTM with the
  specified hidden size.
  
  Pay particular attention to the ``forward`` output.
class_docstr_tok: ["Example","encoder",",","consisting","of","an","embedding","layer","and","a","1-layer","LSTM","with","the","specified","hidden","size",".","Pay","particular","attention","to","the","``","forward","``","output","."]
docstr: Perform the forward pass for the encoder.
  
  Input *must* be input_tokens, which are the context tokens given
  as a matrix of lookup IDs.
  
  :param input_tokens:
      Input tokens as a bsz x seqlen LongTensor.
      Likely will contain padding.
  
  :return:
      You can return anything you like; it is will be passed verbatim
      into the decoder for conditioning. However, it should be something
      you can easily manipulate in ``reorder_encoder_states``.
      This particular implementation returns the hidden and cell states from the
      LSTM.
docstr_tok: ["Perform","the","forward","pass","for","the","encoder",".","Input","*","must","*","be","input_tokens",",","which","are","the","context","tokens","given","as","a","matrix","of","lookup","IDs",".",":","param","input_tokens",":","Input","tokens","as","a","bsz","x","seqlen","LongTensor",".","Likely","will","contain","padding",".",":","return",":","You","can","return","anything","you","like",";","it","is","will","be","passed","verbatim","into","the","decoder","for","conditioning",".","However",",","it","should","be","something","you","can","easily","manipulate","in","``","reorder_encoder_states","``",".","This","particular","implementation","returns","the","hidden","and","cell","states","from","the","LSTM","."]
code: def forward(self, input_tokens):
      """
      Perform the forward pass for the encoder.
  
      Input *must* be input_tokens, which are the context tokens given
      as a matrix of lookup IDs.
  
      :param input_tokens:
          Input tokens as a bsz x seqlen LongTensor.
          Likely will contain padding.
  
      :return:
          You can return anything you like; it is will be passed verbatim
          into the decoder for conditioning. However, it should be something
          you can easily manipulate in ``reorder_encoder_states``.
          This particular implementation returns the hidden and cell states from the
          LSTM.
      """
      embedded = self.embeddings(input_tokens)
      _output, hidden = self.lstm(embedded)
      return hidden
  
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  import torch.nn
  import torch.nn.functional
  import parlai.core.torch_generator_agent
label_desc: Use image node_id 2 for calling the Encoder obj's underlying member method code with example usage: obj.forward(input_tokens) and returns: hidden