'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.'

def __init__(self, inputs, sequence_length, time_major=False, name=None):

    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)
