class_docstr: Reduces the sequence dimension of an input tensor according to the specified reduce_mode.  Any additional
  kwargs are passed on to the reduce mode's constructor.  If using reduce_mode=="attention", the input_size kwarg
  must also be specified.
  
  A sequence is a tensor of 2 or more dimensions, where the shape is [batch size x sequence length x ...].
  
  :param reduce_mode: The reduction mode, one of {"last", "sum", "mean", "max", "concat", "attention", "none"}
  :param max_sequence_length The maximum sequence length.  Only used for computation of shapes - inputs passed
                             at runtime may have a smaller sequence length.
  :param encoding_size The size of each sequence element/embedding vector, or None if input is a sequence of scalars.
code: def __init__(
      self,
      reduce_mode: str = None,
      max_sequence_length: int = 256,
      encoding_size: int = None,
      **kwargs,
  ):
      super().__init__()
      # save as private variable for debugging
      self._reduce_mode = reduce_mode
      self._max_sequence_length = max_sequence_length
      self._encoding_size = encoding_size
      # If embedding size specified and mode is attention, use embedding size as attention module input size
      # unless the input_size kwarg is provided.
      if (
          reduce_mode == "attention"
          and encoding_size
          and "input_size" not in kwargs
      ):
          kwargs["input_size"] = encoding_size
      # use registry to find required reduction function
      self._reduce_obj = get_from_registry(
          reduce_mode, reduce_mode_registry
      )(**kwargs)
  
imports: import logging
  import torch
  from ludwig.modules.attention_modules import FeedForwardAttentionReducer
  from ludwig.utils.misc_utils import get_from_registry
  from ludwig.utils.torch_utils import LudwigModule, sequence_length_3D
label_desc: Use image node_id 1 to create a new SequenceReducer object from inherited base classes: LudwigModule with example: obj = SequenceReducer(reduce_mode, max_sequence_length, encoding_size)