class_docstr: This class can be used to compose several encoders in sequence.
  
  Among other things, this can be used to add a "pre-contextualizer" before a Seq2SeqEncoder.
  
  Registered as a `Seq2SeqEncoder` with name "compose".
  
  # Parameters
  
  encoders : `List[Seq2SeqEncoder]`, required.
      A non-empty list of encoders to compose. The encoders must match in bidirectionality.
docstr: # Parameters
  
  inputs : `torch.Tensor`, required.
      A tensor of shape (batch_size, timesteps, input_dim)
  mask : `torch.BoolTensor`, optional (default = `None`).
      A tensor of shape (batch_size, timesteps).
  
  # Returns
  
  A tensor computed by composing the sequence of encoders.
code: def forward(
      self, inputs: torch.Tensor, mask: torch.BoolTensor = None
  ) -> torch.Tensor:
      """
      # Parameters
  
      inputs : `torch.Tensor`, required.
          A tensor of shape (batch_size, timesteps, input_dim)
      mask : `torch.BoolTensor`, optional (default = `None`).
          A tensor of shape (batch_size, timesteps).
  
      # Returns
  
      A tensor computed by composing the sequence of encoders.
      """
      for encoder in self.encoders:
          inputs = encoder(inputs, mask)
      return inputs
  
file_path: allennlp/allennlp/modules/seq2seq_encoders/compose_encoder.py
imports: import torch
  from typing import List
  from allennlp.modules.seq2seq_encoders.seq2seq_encoder import Seq2SeqEncoder
label_desc: Use image node_id 2 for calling the ComposeEncoder obj's underlying member method code with example usage: obj.forward(inputs, mask) and returns: inputs