code: def test_get_lstm_init_state_prefers_encoder_output_state(num_layers):
      batch_size = 16
      state_size = 64
      combiner_outputs = {}
      combiner_outputs[HIDDEN] = torch.rand([batch_size, state_size])
      combiner_outputs[ENCODER_OUTPUT_STATE] = torch.rand(
          [batch_size, state_size * 2]
      )
  
      (
          decoder_hidden_state,
          decoder_cell_state,
      ) = sequence_decoder_utils.get_lstm_init_state(
          combiner_outputs,
          SequenceReducer(reduce_mode="sum"),
          num_layers,
      )
  
      assert list(decoder_hidden_state.size()) == [
          num_layers,
          batch_size,
          state_size * 2,
      ]
      assert list(decoder_cell_state.size()) == [
          num_layers,
          batch_size,
          state_size * 2,
      ]
  
file_path: ludwig/tests/ludwig/decoders/test_sequence_decoder_utils.py
imports: import pytest
  import torch
  from ludwig.constants import ENCODER_OUTPUT_STATE, HIDDEN
  from ludwig.decoders import sequence_decoder_utils
  from ludwig.modules.reduction_modules import SequenceReducer
label_desc: Use image node_id 4 for calling a global function with example usage: test_get_lstm_init_state_prefers_encoder_output_state(num_layers) without return types