# tf.contrib.seq2seq.AttentionWrapperState

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/seq2seq/python/ops/attention_wrapper.py#L1934-L1995) |

`namedtuple` storing the state of a `AttentionWrapper`.

    tf.contrib.seq2seq.AttentionWrapperState(
        cell_state, attention, time, alignments, alignment_history, attention_state
    )

#### Contains:

- `cell_state`: The state of the wrapped `RNNCell` at the previous time step.
- `attention`: The attention emitted at the previous time step.
- `time`: int32 scalar containing the current time step.
- `alignments`: A single or tuple of `Tensor`(s) containing the alignments emitted at the previous time step for each attention mechanism.
- `alignment_history`: (if enabled) a single or tuple of `TensorArray`(s) containing alignment matrices from all time steps for each attention mechanism. Call `stack()` on each to convert to a `Tensor`.
- `attention_state`: A single or tuple of nested objects containing attention mechanism state for each attention mechanism. The objects may contain Tensors or TensorArrays.

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `cell_state` | <br /> <br /> |
| `attention` | <br /> <br /> |
| `time` | <br /> <br /> |
| `alignments` | <br /> <br /> |
| `alignment_history` | <br /> <br /> |
| `attention_state` | <br /> <br /> |

<br />

## Methods

### `clone`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/seq2seq/python/ops/attention_wrapper.py#L1956-L1995)

    clone(
        **kwargs
    )

Clone this object, overriding components provided by kwargs.

The new state fields' shape must match original state fields' shape. This
will be validated, and original fields' shape will be propagated to new
fields.

#### Example:

    initial_state = attention_wrapper.zero_state(dtype=..., batch_size=...)
    initial_state = initial_state.clone(cell_state=encoder_state)

<br />

<br />

<br />

| Args ||
|---|---|
| `**kwargs` | Any properties of the state object to replace in the returned `AttentionWrapperState`. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| A new `AttentionWrapperState` whose properties are the same as this one, except any overridden properties as provided in `kwargs`. ||

<br />