class_docstr: common layer unittest 
class_docstr_tok: ["common","layer","unittest"]
docstr: test attention
docstr_tok: ["test","attention"]
code: def test_attention(self):
      """test attention"""
      # A 3D tensor [B, T, D]
      inputs = tf.random_uniform(
          shape=[2, 100, 512], dtype=tf.float32, maxval=1.0
      )
      attention_size = 256
      output, alpha = cl.attention(
          inputs, attention_size, return_alphas=True
      )
      output_shape = [2, 512]
      alpha_shape = [2, 100, 1]
      self.assertAllEqual(tf.shape(output), output_shape)
      self.assertAllEqual(tf.shape(alpha), alpha_shape)
  
file_path: delta/delta/layers/common_layers_test.py
imports: import delta.compat
  from absl import logging
  import common_layers
label_desc: Use image node_id 6 for calling the LossUtilTest obj's underlying member method code with example usage: obj.test_attention() without return types