class_docstr: Seq to seq LSTM with attention.
class_docstr_tok: ["Seq","to","seq","LSTM","with","attention","."]
code: def body(self, features):
      # TODO(lukaszkaiser): investigate this issue and repair.
      if self._hparams.initializer == "orthogonal":
          raise ValueError(
              "LSTM models fail with orthogonal initializer."
          )
      train = self._hparams.mode == tf_estimator.ModeKeys.TRAIN
      # This is a temporary fix for varying-length sequences within in a batch.
      # A more complete fix should pass a length tensor from outside so that
      # all the lstm variants can use it.
      input_shape = common_layers.shape_list(features["inputs_raw"])
      flat_input = tf.reshape(
          features["inputs_raw"], [input_shape[0], input_shape[1]]
      )
      inputs_length = tf.reduce_sum(tf.minimum(flat_input, 1), -1)
      target_shape = common_layers.shape_list(features["targets_raw"])
      flat_target = tf.reshape(
          features["targets_raw"], [target_shape[0], target_shape[1]]
      )
      targets_length = tf.reduce_sum(tf.minimum(flat_target, 1), -1)
      tf.logging.info(self._hparams)
      return lstm_seq2seq_internal_attention(
          features["inputs"],
          features["targets"],
          self._hparams,
          train,
          inputs_length,
          targets_length,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  from tensor2tensor.layers import area_attention
  from tensor2tensor.layers import common_hparams
  from tensor2tensor.layers import common_layers
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 1 for calling the LSTMSeq2seqAttention obj's underlying member method code with example usage: obj.body(features) and returns: lstm_seq2seq_internal_attention