code: def attention_builder(name, head_num, activation, history_only, trainable=True):
      
      def _attention_builder(x):
          return MultiHeadAttention(
              head_num=head_num,
              activation=activation,
              history_only=history_only,
              trainable=trainable,
              name=name,
          )(x)
      return _attention_builder
docs: Get multi-head self-attention builder.
  
      :param name: Prefix of names for internal layers.
      :param head_num: Number of heads in multi-head self-attention.
      :param activation: Activation for multi-head self-attention.
      :param history_only: Only use history data.
      :param trainable: Whether the layer is trainable.
      :return: