class_docstr: Multi-head self-attention module.
  
  The module is based on the following three papers:
   * A simple neural network module for relational reasoning (RNs):
       https://arxiv.org/abs/1706.01427
   * Non-local Neural Networks: https://arxiv.org/abs/1711.07971.
   * Attention Is All You Need (AIAYN): https://arxiv.org/abs/1706.03762.
  
  The input to the modules consists of a graph containing values for each node
  and connectivity between them, a tensor containing keys for each node
  and a tensor containing queries for each node.
  
  The self-attention step consist of updating the node values, with each new
  node value computed in a two step process:
  - Computing the attention weights between each node and all of its senders
   nodes, by calculating sum(sender_key*receiver_query) and using the softmax
   operation on all attention weights for each node.
  - For each receiver node, compute the new node value as the weighted average
   of the values of the sender nodes, according to the attention weights.
  - Nodes with no received edges, get an updated value of 0.
  
  Values, keys and queries contain a "head" axis to compute independent
  self-attention for each of the heads.
docstr: Inits the module.
  
  Args:
    name: The module name.
code: def __init__(self, name="self_attention"):
      """Inits the module.
  
      Args:
        name: The module name.
      """
      super(SelfAttention, self).__init__(name=name)
      self._normalizer = _unsorted_segment_softmax
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from graph_nets import _base
  from graph_nets import blocks
  import tensorflow
label_desc: Use image node_id 1 to create a new SelfAttention object from inherited base classes: _base with example: obj = SelfAttention(name)