code: def test_sequence_encoders(
      encoder_type: Type, reduce_output: str, vocab_size: int
  ):
      # make repeatable
      torch.manual_seed(RANDOM_SEED)
  
      batch_size = 10
      sequence_length = 32
      sequence_encoder = encoder_type(
          vocab=list(range(1, vocab_size + 1)),
          max_sequence_length=sequence_length,
          reduce_output=reduce_output,
      ).to(DEVICE)
      inputs = torch.randint(2, (batch_size, sequence_length)).to(
          DEVICE
      )
      outputs = sequence_encoder(inputs)
      assert (
          outputs[ENCODER_OUTPUT].shape[1:]
          == sequence_encoder.output_shape
      )
  
      # check for parameter updating
      target = torch.randn(outputs[ENCODER_OUTPUT].shape)
      fpc, tpc, upc, not_updated = check_module_parameters_updated(
          sequence_encoder, (inputs,), target
      )
  
      assert (
          upc == tpc
      ), f"Not all parameters updated.  Parameters not updated: {not_updated}.\nModule: {sequence_encoder}"
  
file_path: ludwig/tests/ludwig/encoders/test_sequence_encoders.py
imports: from typing import Type
  import pytest
  import torch
  from ludwig.constants import ENCODER_OUTPUT
  from ludwig.encoders.sequence_encoders import ParallelCNN, SequenceEmbedEncoder, SequencePassthroughEncoder, StackedCNN, StackedCNNRNN, StackedParallelCNN, StackedRNN, StackedTransformer
  from ludwig.utils.torch_utils import get_torch_device
  from tests.integration_tests.parameter_update_utils import check_module_parameters_updated
label_desc: Use image node_id 2 for calling a global function with example usage: test_sequence_encoders(encoder_type, reduce_output, vocab_size) without return types