code: def test_dropout_version_is_different_to_no_dropout(self):
      augmented_lstm = AugmentedLstm(10, 11)
      dropped_augmented_lstm = AugmentedLstm(
          10, 11, recurrent_dropout_probability=0.9
      )
      # Initialize all weights to be == 1.
      constant_init = Initializer.from_params(
          Params({"type": "constant", "val": 0.5})
      )
      initializer = InitializerApplicator([(".*", constant_init)])
      initializer(augmented_lstm)
      initializer(dropped_augmented_lstm)
  
      initial_state = torch.randn([1, 5, 11])
      initial_memory = torch.randn([1, 5, 11])
  
      # If we use too bigger number like in the PyTorch test the dropout has no affect
      sorted_tensor, sorted_sequence, _, _ = sort_batch_by_length(
          self.random_tensor, self.sequence_lengths
      )
      lstm_input = pack_padded_sequence(
          sorted_tensor, sorted_sequence.data.tolist(), batch_first=True
      )
  
      augmented_output, augmented_state = augmented_lstm(
          lstm_input, (initial_state, initial_memory)
      )
      dropped_output, dropped_state = dropped_augmented_lstm(
          lstm_input, (initial_state, initial_memory)
      )
      dropped_output_sequence, _ = pad_packed_sequence(
          dropped_output, batch_first=True
      )
      augmented_output_sequence, _ = pad_packed_sequence(
          augmented_output, batch_first=True
      )
      with pytest.raises(AssertionError):
          numpy.testing.assert_array_almost_equal(
              dropped_output_sequence.data.numpy(),
              augmented_output_sequence.data.numpy(),
              decimal=4,
          )
      with pytest.raises(AssertionError):
          numpy.testing.assert_array_almost_equal(
              dropped_state[0].data.numpy(),
              augmented_state[0].data.numpy(),
              decimal=4,
          )
      with pytest.raises(AssertionError):
          numpy.testing.assert_array_almost_equal(
              dropped_state[1].data.numpy(),
              augmented_state[1].data.numpy(),
              decimal=4,
          )
  
imports: import pytest
  import numpy
  import torch
  import torch.nn.init
  from torch.nn.modules.rnn import LSTM
  from torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.params import Params
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.modules.augmented_lstm import AugmentedLstm, AugmentedLSTMCell, BiAugmentedLstm
  from allennlp.nn import InitializerApplicator, Initializer
  from allennlp.nn.util import sort_batch_by_length
label_desc: Use image node_id 9 for calling the TestAugmentedLSTM obj's underlying member method code with example usage: obj.test_dropout_version_is_different_to_no_dropout() without return types