code: def test_sequence_encoders(
      encoder_type: Encoder, trainable: bool, reduce_output: str
  ):
      num_sentences = 4
      embedding_size = 5
      max_len = 7
      output_size = 3
  
      # make repeatable
      np.random.seed(RANDOM_SEED)
      torch.manual_seed(RANDOM_SEED)
  
      # Generate data
      text, vocab = generate_random_sentences(
          num_sentences=num_sentences,
          max_len=max_len,
      )
  
      encoder_kwargs = {
          "embedding_size": embedding_size,
          "vocab": vocab,
          "output_size": output_size,
          "num_fc_layers": 1,
          "filter_size": 3,
          "num_filters": 8,
          "state_size": output_size,
      }
  
      # todo figure out the output size for parallel 1d conv
      output_shape = [num_sentences, output_size]
  
      encoder_kwargs["embeddings_trainable"] = trainable
      encoder_kwargs["dropout"] = DROPOUT
      encoder_kwargs["recurrent_dropout"] = DROPOUT
      encoder_kwargs["fc_dropout"] = DROPOUT
      encoder_kwargs["reduce_output"] = reduce_output
      encoder = create_encoder(
          encoder_type, max_sequence_length=max_len, **encoder_kwargs
      )
  
      encoder_test(
          encoder=encoder,
          input_data=text,
          output_dtype=torch.float32,
          output_shape=output_shape,
          output_data=None,
      )
  
      assert isinstance(encoder, encoder_type)
  
      # test for parameter updates
      # generate tensors for parameter update test
      target = torch.rand(output_shape)
  
      # check for parameter updates
      fpc, tpc, upc, not_updated = check_module_parameters_updated(
          encoder, (torch.tensor(text, dtype=torch.int32),), target
      )
  
      if trainable:
          assert (
              fpc == 0
          ), "Embedding layer expected to be trainable but found to be frozen"
      else:
          assert (
              fpc == 1
          ), "Embedding layer expected to be frozen, but found to be trainable."
  
      # for given random seed and configuration and non-zero dropout updated parameter counts
      # could take on different values
      assert (upc == tpc) or (upc == 0), (
          f"Not all trainable parameters updated.  Parameters not updated: {not_updated}."
          f"  Module structure\n{encoder}"
      )
  
imports: import random
  import numpy
  import pytest
  import torch
  from ludwig.constants import ENCODER_OUTPUT
  from ludwig.data.dataset_synthesizer import build_vocab
  from ludwig.encoders.base import Encoder
  from ludwig.encoders.image.base import MLPMixerEncoder, Stacked2DCNN
  from ludwig.encoders.sequence_encoders import ParallelCNN, SequenceEmbedEncoder, StackedCNN, StackedCNNRNN, StackedParallelCNN, StackedRNN
  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 10 for calling a global function with example usage: test_sequence_encoders(encoder_type, trainable, reduce_output) without return types