title: DynamicAttentionWrapper module issue with tensorflow
body: <p>I am referring to a <a href="https://github.com/Currie32/Text-Summarization-with-Amazon-Reviews/blob/master/summarize_reviews.ipynb" rel="nofollow noreferrer">Kaggle notebook</a>. Looks like the below code should work fine with Tensorflow 1.1. Upon running this with Tensorflow with any latest version, I am getting the following error:</p>
  
  <p>"AttributeError: module 'tensorflow.contrib.seq2seq' has no attribute 'DynamicAttentionWrapper'"</p>
  
  <p>So I modified DynamicAttentionWrapper to AttentionWrapper. Now I am getting another error stating:
  " <strong>new</strong>() missing 3 required positional arguments: 'time', 'alignments', and 'alignment_history'"</p>
  
  <pre><code> dec_cell = tf.contrib.seq2seq.DynamicAttentionWrapper(dec_cell,
                                                            attn_mech,
                                                            rnn_size)
  
      initial_state = tf.contrib.seq2seq.DynamicAttentionWrapperState(enc_state[0],
                                                                      _zero_state_tensors(rnn_size, 
                                                                                          batch_size, 
                                                                                          tf.float32)) 
  </code></pre>
  
  <p>Can somebody help me here.</p>
  
  <p>So I modified </p>
  
  <pre><code># Build the graph
  train_graph = tf.Graph()
  # Set the graph to default to ensure that it is ready for training
  with train_graph.as_default():
  
      # Load the model inputs    
      input_data, targets, lr, keep_prob, summary_length, max_summary_length, text_length = model_inputs()
  
      # Create the training and inference logits
      training_logits, inference_logits = seq2seq_model(tf.reverse(input_data, [-1]),
                                                        targets, 
                                                        keep_prob,   
                                                        text_length,
                                                        summary_length,
                                                        max_summary_length,
                                                        len(vocab_to_int)+1,
                                                        rnn_size, 
                                                        num_layers, 
                                                        vocab_to_int,
                                                        batch_size)
  
      # Create tensors for the training logits and inference logits
      # Step 1
      training_logits = tf.identity(training_logits.rnn_output, 'logits')
      # Step 2
      inference_logits = tf.identity(inference_logits.sample_id, name='predictions')
  
      # Create the weights for sequence_loss
      masks = tf.sequence_mask(summary_length, max_summary_length, dtype=tf.float32, name='masks')
  
      with tf.name_scope("optimization"):
          # Loss function
          cost = tf.contrib.seq2seq.sequence_loss(
              training_logits,
              targets,
              masks)
  
          # Optimizer
          optimizer = tf.train.AdamOptimizer(learning_rate)
  
          # Gradient Clipping
          gradients = optimizer.compute_gradients(cost)
          capped_gradients = [(tf.clip_by_value(grad, -5., 5.), var) for grad, var in gradients if grad is not None]
          train_op = optimizer.apply_gradients(capped_gradients)
  print("Graph is built.")
  </code></pre>