code: def test_lstm_decoder(num_layers, batch_size):
      hidden_size = 256
      vocab_size = 50
  
      input = torch.randint(vocab_size, size=(batch_size,))
      initial_hidden = torch.zeros(num_layers, batch_size, hidden_size)
      initial_cell_state = torch.zeros(
          num_layers, batch_size, hidden_size
      )
      lstm_decoder = LSTMDecoder(
          hidden_size, vocab_size, num_layers=num_layers
      )
  
      output = lstm_decoder(input, initial_hidden, initial_cell_state)
  
      assert len(output) == 3
      assert list(output[0].size()) == [batch_size, 1, vocab_size]
      assert list(output[1].size()) == [
          num_layers,
          batch_size,
          hidden_size,
      ]
      assert list(output[2].size()) == [
          num_layers,
          batch_size,
          hidden_size,
      ]
  
file_path: ludwig/tests/ludwig/decoders/test_sequence_decoder.py
imports: import pytest
  import torch
  from ludwig.constants import HIDDEN, LOGITS
  from ludwig.decoders.sequence_decoders import LSTMDecoder, RNNDecoder, SequenceGeneratorDecoder, SequenceLSTMDecoder, SequenceRNNDecoder
  from ludwig.utils.misc_utils import set_random_seed
  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_lstm_decoder(num_layers, batch_size) without return types