code: def test_masking():
      memory = tf.ones([4, 4, 5], dtype=tf.float32)
      memory_sequence_length = tf.constant([1, 2, 3, 4], dtype=tf.int32)
      query = tf.ones([4, 5], dtype=tf.float32)
      state = None
      attention = wrapper.LuongAttention(
          5, memory, memory_sequence_length
      )
      alignment, _ = attention([query, state])
      assert np.sum(np.triu(alignment, k=1)) == 0
  
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 7 for calling a global function with example usage: test_masking() without return types