class_docstr: A helper for use during training.  Only reads inputs.
  
  Returned sample_ids are the argmax of the RNN output logits.
class_docstr_tok: ["A","helper","for","use","during","training",".","Only","reads","inputs",".","Returned","sample_ids","are","the","argmax","of","the","RNN","output","logits","."]
docstr: Initializer.
  
  Args:
    inputs: A (structure of) input tensors.
    sequence_length: An int32 vector tensor.
    time_major: Python bool.  Whether the tensors in `inputs` are time major.
      If `False` (default), they are assumed to be batch major.
    name: Name scope for any created operations.
  
  Raises:
    ValueError: if `sequence_length` is not a 1D tensor.
docstr_tok: ["Initializer",".","Args",":","inputs",":","A","(","structure","of",")","input","tensors",".","sequence_length",":","An","int32","vector","tensor",".","time_major",":","Python","bool",".","Whether","the","tensors","in","`","inputs","`","are","time","major",".","If","`","False","`","(","default",")",",","they","are","assumed","to","be","batch","major",".","name",":","Name","scope","for","any","created","operations",".","Raises",":","ValueError",":","if","`","sequence_length","`","is","not","a","1D","tensor","."]
code: def __init__(
      self, inputs, sequence_length, time_major=False, name=None
  ):
      """Initializer.
  
      Args:
        inputs: A (structure of) input tensors.
        sequence_length: An int32 vector tensor.
        time_major: Python bool.  Whether the tensors in `inputs` are time major.
          If `False` (default), they are assumed to be batch major.
        name: Name scope for any created operations.
  
      Raises:
        ValueError: if `sequence_length` is not a 1D tensor.
      """
      with ops.name_scope(
          name, "TrainingHelper", [inputs, sequence_length]
      ):
          inputs = ops.convert_to_tensor(inputs, name="inputs")
          if not time_major:
              inputs = nest.map_structure(_transpose_batch_time, inputs)
  
          self._input_tas = nest.map_structure(_unstack_ta, inputs)
          self._sequence_length = ops.convert_to_tensor(
              sequence_length, name="sequence_length"
          )
          if self._sequence_length.get_shape().ndims != 1:
              raise ValueError(
                  "Expected sequence_length to be a vector, but received shape: %s"
                  % self._sequence_length.get_shape()
              )
  
          self._zero_inputs = nest.map_structure(
              lambda inp: array_ops.zeros_like(inp[0, :]), inputs
          )
  
          self._batch_size = array_ops.size(sequence_length)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import six
  from tensorflow.contrib.distributions.python.ops import bernoulli
  from tensorflow.contrib.distributions.python.ops import categorical
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.layers import base
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import embedding_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import tensor_array_ops
  from tensorflow.python.util import nest
  from seq2seq.contrib.seq2seq import decoder
label_desc: Use image node_id 1 to create a new TrainingHelper object from inherited base classes: Helper with example: obj = TrainingHelper(inputs, sequence_length, time_major, name)