class_docstr: Attention Layer: input shape should be[batch_size, seq_length, feature_dim]
code: def __init__(
      self,
      out_dim,
      activation=tf.nn.elu,
      activation_out=lambda x: x,
      hidden_dim=[],
      head_num=[1],
      **kwargs,
  ):
      super(AttLayer, self).__init__(**kwargs)
      self.hidden_dim = hidden_dim
      self.out_dim = out_dim
      self.head_num = head_num
      self.activation = activation
      self.activation_out = activation_out
      if len(head_num) < 1 or len(head_num) != len(hidden_dim) + 1:
          raise ValueError(
              "head_num must be greater than 1 and greater"
              " than hidden, got {},{}".format(
                  str(head_num), str(hidden_dim)
              )
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import tensorflow
  from tensorflow.python.util import nest
label_desc: Use image node_id 1 to create a new AttLayer object from inherited base classes: Layer with example: obj = AttLayer(out_dim, activation, activation_out, hidden_dim, head_num)