class_docstr: Refer to [Hierarchical Attention Networks for Document Classification]
    (https://www.cs.cmu.edu/~hovy/papers/16HLT-hierarchical-attention-networks.pdf)
    wrap `with tf.variable_scope(name, reuse=tf.AUTO_REUSE):`
  Input shape: (Batch size, steps, features)
  Output shape: (Batch size, features)
class_docstr_tok: ["Refer","to","[","Hierarchical","Attention","Networks","for","Document","Classification","]","(","https",":","\/\/www.cs.cmu.edu\/~hovy\/papers\/16HLT-hierarchical-attention-networks.pdf",")","wrap","`","with","tf.variable_scope","(","name",",","reuse=tf.AUTO_REUSE",")",":","`","Input","shape",":","(","Batch","size",",","steps",",","features",")","Output","shape",":","(","Batch","size",",","features",")"]
code: def build(self, input_shape):
      # pylint: disable=attribute-defined-outside-init
      assert len(input_shape) == 3
  
      self.W = self.add_weight(
          name="{}_W".format(self.name),
          shape=(
              int(input_shape[-1]),
              int(input_shape[-1]),
          ),
          initializer=self.init,
          regularizer=self.W_regularizer,
          constraint=self.W_constraint,
      )
  
      if self.use_bias:
          self.b = self.add_weight(
              name="{}_b".format(self.name),
              shape=(int(input_shape[-1]),),
              initializer="zero",
              regularizer=self.b_regularizer,
              constraint=self.b_constraint,
          )
  
      self.attention_context_vector = self.add_weight(
          name="{}_att_context_v".format(self.name),
          shape=(int(input_shape[-1]),),
          initializer=self.init,
          regularizer=self.u_regularizer,
          constraint=self.u_constraint,
      )
      self.built = True
  
file_path: delta/delta/layers/attention.py
imports: from absl import logging
  import delta.compat
  from delta.layers.base_layer import Layer
label_desc: Use image node_id 2 for calling the HanAttention obj's underlying member method code with example usage: obj.build(input_shape) without return types