class_docstr: A training helper that adds scheduled sampling.
  
  Returns -1s for sample_ids where no sampling took place; valid sample id
  values elsewhere.
class_docstr_tok: ["A","training","helper","that","adds","scheduled","sampling",".","Returns","-1s","for","sample_ids","where","no","sampling","took","place",";","valid","sample","id","values","elsewhere","."]
docstr: Initializer.
  
  Args:
    inputs: A (structure of) input tensors.
    sequence_length: An int32 vector tensor.
    embedding: A callable that takes a vector tensor of `ids` (argmax ids),
      or the `params` argument for `embedding_lookup`.
    sampling_probability: A 0D `float32` tensor: the probability of sampling
      categorically from the output ids instead of reading directly from the
      inputs.
    time_major: Python bool.  Whether the tensors in `inputs` are time major.
      If `False` (default), they are assumed to be batch major.
    seed: The sampling seed.
    scheduling_seed: The schedule decision rule sampling seed.
    name: Name scope for any created operations.
  
  Raises:
    ValueError: if `sampling_probability` is not a scalar or vector.
docstr_tok: ["Initializer",".","Args",":","inputs",":","A","(","structure","of",")","input","tensors",".","sequence_length",":","An","int32","vector","tensor",".","embedding",":","A","callable","that","takes","a","vector","tensor","of","`","ids","`","(","argmax","ids",")",",","or","the","`","params","`","argument","for","`","embedding_lookup","`",".","sampling_probability",":","A","0D","`","float32","`","tensor",":","the","probability","of","sampling","categorically","from","the","output","ids","instead","of","reading","directly","from","the","inputs",".","time_major",":","Python","bool",".","Whether","the","tensors","in","`","inputs","`","are","time","major",".","If","`","False","`","(","default",")",",","they","are","assumed","to","be","batch","major",".","seed",":","The","sampling","seed",".","scheduling_seed",":","The","schedule","decision","rule","sampling","seed",".","name",":","Name","scope","for","any","created","operations",".","Raises",":","ValueError",":","if","`","sampling_probability","`","is","not","a","scalar","or","vector","."]
code: def __init__(
      self,
      inputs,
      sequence_length,
      embedding,
      sampling_probability,
      time_major=False,
      seed=None,
      scheduling_seed=None,
      name=None,
  ):
      """Initializer.
  
      Args:
        inputs: A (structure of) input tensors.
        sequence_length: An int32 vector tensor.
        embedding: A callable that takes a vector tensor of `ids` (argmax ids),
          or the `params` argument for `embedding_lookup`.
        sampling_probability: A 0D `float32` tensor: the probability of sampling
          categorically from the output ids instead of reading directly from the
          inputs.
        time_major: Python bool.  Whether the tensors in `inputs` are time major.
          If `False` (default), they are assumed to be batch major.
        seed: The sampling seed.
        scheduling_seed: The schedule decision rule sampling seed.
        name: Name scope for any created operations.
  
      Raises:
        ValueError: if `sampling_probability` is not a scalar or vector.
      """
      with ops.name_scope(
          name,
          "ScheduledEmbeddingSamplingWrapper",
          [embedding, sampling_probability],
      ):
          if callable(embedding):
              self._embedding_fn = embedding
          else:
              self._embedding_fn = (
                  lambda ids: embedding_ops.embedding_lookup(
                      embedding, ids
                  )
              )
          self._sampling_probability = ops.convert_to_tensor(
              sampling_probability, name="sampling_probability"
          )
          if self._sampling_probability.get_shape().ndims not in (0, 1):
              raise ValueError(
                  "sampling_probability must be either a scalar or a vector. "
                  "saw shape: %s"
                  % (self._sampling_probability.get_shape())
              )
          self._seed = seed
          self._scheduling_seed = scheduling_seed
          super(ScheduledEmbeddingTrainingHelper, self).__init__(
              inputs=inputs,
              sequence_length=sequence_length,
              time_major=time_major,
              name=name,
          )
  
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 ScheduledEmbeddingTrainingHelper object from inherited base classes: TrainingHelper with example: obj = ScheduledEmbeddingTrainingHelper(inputs, sequence_length, embedding, sampling_probability, time_major, seed, scheduling_seed, name)