code: def test_attention_state_with_variable_length_input():
      cell = tf.keras.layers.LSTMCell(3)
      mechanism = wrapper.LuongAttention(units=3)
      cell = wrapper.AttentionWrapper(cell, mechanism)
  
      var_len = tf.random.uniform(
          shape=(), minval=2, maxval=10, dtype=tf.int32
      )
      lengths = tf.random.uniform(
          shape=(var_len,), minval=1, maxval=var_len + 1, dtype=tf.int32
      )
      data = tf.ones(shape=(var_len, var_len, 3))
      mask = tf.sequence_mask(lengths, maxlen=var_len)
  
      mechanism.setup_memory(data)
      layer = tf.keras.layers.RNN(cell)
  
      _ = layer(data, mask=mask)
  
imports: import collections
  from packaging.version import Version
  import pytest
  import numpy
  import tensorflow
  from tensorflow_addons.seq2seq import attention_wrapper
  from tensorflow_addons.seq2seq import basic_decoder
  from tensorflow_addons.seq2seq import sampler
label_desc: Use image node_id 26 for calling a global function with example usage: test_attention_state_with_variable_length_input() without return types