code: def input_sequence() -> torch.Tensor:
      # generates a realistic looking synthetic sequence tensor, i.e.
      # each sequence will have non-zero tokens at the beginning with
      # trailing zero tokens, including a max length token with a single
      # zero token at the end.  Example:
      # [
      #   [3, 5, 6, 0, 0, 0],
      #   [10, 11, 12, 13, 14, 0],   # max length sequence
      #   [32, 0, 0, 0, 0, 0]        # minimum length sequence
      # ]
      input_tensor = torch.zeros(
          [BATCH_SIZE, SEQ_SIZE], dtype=torch.int32
      )
      sequence_lengths = np.random.randint(1, SEQ_SIZE, size=BATCH_SIZE)
      for i in range(input_tensor.shape[0]):
          input_tensor[i, : sequence_lengths[i]] = torch.tensor(
              np.random.randint(
                  2, TEST_VOCAB_SIZE, size=sequence_lengths[i]
              )
          )
  
      if torch.cuda.is_available():
          input_tensor = input_tensor.cuda()
  
      return input_tensor
  
file_path: ludwig/tests/integration_tests/test_sequence_encoders.py
imports: import logging
  from typing import Union
  import numpy
  import pytest
  import torch
  from ludwig.constants import ENCODER_OUTPUT, ENCODER_OUTPUT_STATE, SEQUENCE
  from ludwig.encoders.registry import get_encoder_cls
  from tests.integration_tests.utils import ENCODERS
label_desc: Use image node_id 1 for calling a global function with example usage: input_sequence() and returns: input_tensor