def __init__(self,
                 num_units,
                 memory,
                 memory_sequence_mask=None,
                 normalize=False,
                 probability_fn=None,
                 score_mask_value=None,
                 dtype=None,
                 custom_key_value_fn=None,
                 name="MyBahdanauAttention"):
        """Construct the Attention mechanism.
        Args:
            num_units: The depth of the query mechanism.
            memory: The memory to query; usually the output of an RNN encoder.    This
                tensor should be shaped `[batch_size, max_time, ...]`.
            memory_sequence_length: (optional) Sequence lengths for the batch entries
                in memory.    If provided, the memory tensor rows are masked with zeros
                for values past the respective sequence lengths.
            normalize: Python boolean.    Whether to normalize the energy term.
            probability_fn: (optional) A `callable`.    Converts the score to
                probabilities.    The default is `tf.nn.softmax`. Other options include
                `tf.contrib.seq2seq.hardmax` and `tf.contrib.sparsemax.sparsemax`.
                Its signature should be: `probabilities = probability_fn(score)`.
            score_mask_value: (optional): The mask value for score before passing into
                `probability_fn`. The default is -inf. Only used if
                `memory_sequence_length` is not None.
            dtype: The data type for the query and memory layers of the attention
                mechanism.
            custom_key_value_fn: (optional): The custom function for
                computing keys and values.
            name: Name to use when creating ops.
        """
        super(MyAttention, self).__init__(num_units,
                                        memory,
                                        name=name)
        self.memory_sequence_mask = memory_sequence_mask
Construct the Attention mechanism.
        Args:
            num_units: The depth of the query mechanism.
            memory: The memory to query; usually the output of an RNN encoder.    This
                tensor should be shaped `[batch_size, max_time, ...]`.
            memory_sequence_length: (optional) Sequence lengths for the batch entries
                in memory.    If provided, the memory tensor rows are masked with zeros
                for values past the respective sequence lengths.
            normalize: Python boolean.    Whether to normalize the energy term.
            probability_fn: (optional) A `callable`.    Converts the score to
                probabilities.    The default is `tf.nn.softmax`. Other options include
                `tf.contrib.seq2seq.hardmax` and `tf.contrib.sparsemax.sparsemax`.
                Its signature should be: `probabilities = probability_fn(score)`.
            score_mask_value: (optional): The mask value for score before passing into
                `probability_fn`. The default is -inf. Only used if
                `memory_sequence_length` is not None.
            dtype: The data type for the query and memory layers of the attention
                mechanism.
            custom_key_value_fn: (optional): The custom function for
                computing keys and values.
            name: Name to use when creating ops.
        
benchmark/hred/utils/output_projection.py