def __init__(self, num_units, memory, const_batch_size, memory_sequence_length=None, scale=False, probability_fn=None, score_mask_value=None, dtype=None, name='LocalLuongAttention', d=10, attention_mode=AttentionMode.MONOTONIC, score_mode=AttentionScore.DOT, force_gaussian=False):
    '\n        Arguments:\n            num_units (int):\n                The depth of the attention mechanism. This controls the number of units in the\n                memory layer that processes the encoder states into the `keys`.\n\n            memory (tf.Tensor):\n                The memory to query; usually the output of an RNN encoder.\n                The shape is expected to be shape=(batch_size, encoder_max_time, ...)\n\n            const_batch_size (int):\n                The constant batch size to expect from every batch. Every batch is expected to\n                contain exactly `const_batch_size` samples.\n\n            memory_sequence_length:\n                (optional) Sequence lengths for the batch entries\n                in memory.  If provided, the memory tensor rows are masked with zeros\n                for values past the respective sequence lengths.\n\n            scale (boolean):\n                Whether to scale the energy term.\n\n            probability_fn:\n                (optional) A `callable`.  Converts the score to\n                probabilities.  The default is @{tf.nn.softmax}. Other options include\n                @{tf.contrib.seq2seq.hardmax} and @{tf.contrib.sparsemax.sparsemax}.\n                Its signature should be: `probabilities = probability_fn(score)`.\n\n            score_mask_value:\n                (optional) The mask value for score before passing into\n                `probability_fn`. The default is -inf. Only used if\n                `memory_sequence_length` is not None.\n\n            dtype (tf.DType):\n                The data type for the memory layer of the attention mechanism.\n\n            name (string):\n                Name to use when creating ops.\n\n            d (int):\n                D parameter controlling the window size and gaussian distribution.\n                The window size is set to be `2D + 1`.\n\n            attention_mode (AttentionMode):\n                The attention mode to use. Can be either `MONOTONIC` or `PREDICTIVE`.\n\n            score_mode (AttentionScore):\n                The attention scoring function to use. Can either be `DOT`, `GENERAL` or `CONCAT`.\n\n            force_gaussian (boolean):\n                Force a gaussian distribution onto the scores in the attention window.\n                Defaults to False.\n        '
    super().__init__(num_units=num_units, memory=memory, memory_sequence_length=memory_sequence_length, scale=scale, probability_fn=probability_fn, score_mask_value=score_mask_value, dtype=dtype, name=name)
    self.time = 0
    self.d = d
    self.window_size = ((2 * self.d) + 1)
    self.attention_mode = attention_mode
    self.score_mode = score_mode
    self.const_batch_size = const_batch_size
    self.force_gaussian = force_gaussian
Arguments:
    num_units (int):
        The depth of the attention mechanism. This controls the number of units in the
        memory layer that processes the encoder states into the `keys`.

    memory (tf.Tensor):
        The memory to query; usually the output of an RNN encoder.
        The shape is expected to be shape=(batch_size, encoder_max_time, ...)

    const_batch_size (int):
        The constant batch size to expect from every batch. Every batch is expected to
        contain exactly `const_batch_size` samples.

    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.

    scale (boolean):
        Whether to scale 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 (tf.DType):
        The data type for the memory layer of the attention mechanism.

    name (string):
        Name to use when creating ops.

    d (int):
        D parameter controlling the window size and gaussian distribution.
        The window size is set to be `2D + 1`.

    attention_mode (AttentionMode):
        The attention mode to use. Can be either `MONOTONIC` or `PREDICTIVE`.

    score_mode (AttentionScore):
        The attention scoring function to use. Can either be `DOT`, `GENERAL` or `CONCAT`.

    force_gaussian (boolean):
        Force a gaussian distribution onto the scores in the attention window.
        Defaults to False.
def __init__(self, num_units, memory, const_batch_size, memory_sequence_length=None, scale=False, probability_fn=None, score_mask_value=None, dtype=None, name='LocalLuongAttention', d=10, attention_mode=AttentionMode.MONOTONIC, score_mode=AttentionScore.DOT, force_gaussian=False):
    '\n        Arguments:\n            num_units (int):\n                The depth of the attention mechanism. This controls the number of units in the\n                memory layer that processes the encoder states into the `keys`.\n\n            memory (tf.Tensor):\n                The memory to query; usually the output of an RNN encoder.\n                The shape is expected to be shape=(batch_size, encoder_max_time, ...)\n\n            const_batch_size (int):\n                The constant batch size to expect from every batch. Every batch is expected to\n                contain exactly `const_batch_size` samples.\n\n            memory_sequence_length:\n                (optional) Sequence lengths for the batch entries\n                in memory.  If provided, the memory tensor rows are masked with zeros\n                for values past the respective sequence lengths.\n\n            scale (boolean):\n                Whether to scale the energy term.\n\n            probability_fn:\n                (optional) A `callable`.  Converts the score to\n                probabilities.  The default is @{tf.nn.softmax}. Other options include\n                @{tf.contrib.seq2seq.hardmax} and @{tf.contrib.sparsemax.sparsemax}.\n                Its signature should be: `probabilities = probability_fn(score)`.\n\n            score_mask_value:\n                (optional) The mask value for score before passing into\n                `probability_fn`. The default is -inf. Only used if\n                `memory_sequence_length` is not None.\n\n            dtype (tf.DType):\n                The data type for the memory layer of the attention mechanism.\n\n            name (string):\n                Name to use when creating ops.\n\n            d (int):\n                D parameter controlling the window size and gaussian distribution.\n                The window size is set to be `2D + 1`.\n\n            attention_mode (AttentionMode):\n                The attention mode to use. Can be either `MONOTONIC` or `PREDICTIVE`.\n\n            score_mode (AttentionScore):\n                The attention scoring function to use. Can either be `DOT`, `GENERAL` or `CONCAT`.\n\n            force_gaussian (boolean):\n                Force a gaussian distribution onto the scores in the attention window.\n                Defaults to False.\n        '
    super().__init__(num_units=num_units, memory=memory, memory_sequence_length=memory_sequence_length, scale=scale, probability_fn=probability_fn, score_mask_value=score_mask_value, dtype=dtype, name=name)
    self.time = 0
    self.d = d
    self.window_size = ((2 * self.d) + 1)
    self.attention_mode = attention_mode
    self.score_mode = score_mode
    self.const_batch_size = const_batch_size
    self.force_gaussian = force_gaussian