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 call(self, inputs, training=None, mask=None):
      batch_size = tf.shape(inputs)[0]
      W_3d = tf.tile(
          tf.expand_dims(self.W, axis=0), tf.stack([batch_size, 1, 1])
      )
      # [batch_size, steps, features]
      input_projection = tf.matmul(inputs, W_3d)
  
      if self.use_bias:
          input_projection += self.b
  
      input_projection = tf.tanh(input_projection)
  
      # [batch_size, steps, 1]
      similaritys = tf.reduce_sum(
          tf.multiply(input_projection, self.attention_context_vector),
          axis=2,
          keep_dims=True,
      )
  
      # [batch_size, steps, 1]
      if mask is not None:
          attention_weights = masked_softmax(similaritys, mask, axis=1)
      else:
          attention_weights = tf.nn.softmax(similaritys, axis=1)
  
      # [batch_size, features]
      attention_output = tf.reduce_sum(
          tf.multiply(inputs, attention_weights), axis=1
      )
      return attention_output
  
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 4 for calling the HanAttention obj's underlying member method code with example usage: obj.call(inputs, training, mask) and returns: attention_output