class_docstr: A helper for use during inference.
  
  Uses the argmax of the output (treated as logits) and passes the
  result through an embedding layer to get the next input.
class_docstr_tok: ["A","helper","for","use","during","inference",".","Uses","the","argmax","of","the","output","(","treated","as","logits",")","and","passes","the","result","through","an","embedding","layer","to","get","the","next","input","."]
docstr: Initializer.
  
  Args:
    embedding: A callable that takes a vector tensor of `ids` (argmax ids),
      or the `params` argument for `embedding_lookup`.
    start_tokens: `int32` vector shaped `[batch_size]`, the start tokens.
    end_token: `int32` scalar, the token that marks end of decoding.
  
  Raises:
    ValueError: if `sequence_length` is not a 1D tensor.
docstr_tok: ["Initializer",".","Args",":","embedding",":","A","callable","that","takes","a","vector","tensor","of","`","ids","`","(","argmax","ids",")",",","or","the","`","params","`","argument","for","`","embedding_lookup","`",".","start_tokens",":","`","int32","`","vector","shaped","`","[","batch_size","]","`",",","the","start","tokens",".","end_token",":","`","int32","`","scalar",",","the","token","that","marks","end","of","decoding",".","Raises",":","ValueError",":","if","`","sequence_length","`","is","not","a","1D","tensor","."]
code: def __init__(self, embedding, start_tokens, end_token):
      """Initializer.
  
      Args:
        embedding: A callable that takes a vector tensor of `ids` (argmax ids),
          or the `params` argument for `embedding_lookup`.
        start_tokens: `int32` vector shaped `[batch_size]`, the start tokens.
        end_token: `int32` scalar, the token that marks end of decoding.
  
      Raises:
        ValueError: if `sequence_length` is not a 1D tensor.
      """
      if callable(embedding):
          self._embedding_fn = embedding
      else:
          self._embedding_fn = (
              lambda ids: embedding_ops.embedding_lookup(embedding, ids)
          )
  
      self._start_tokens = ops.convert_to_tensor(
          start_tokens, dtype=dtypes.int32, name="start_tokens"
      )
      self._end_token = ops.convert_to_tensor(
          end_token, dtype=dtypes.int32, name="end_token"
      )
      if self._start_tokens.get_shape().ndims != 1:
          raise ValueError("start_tokens must be a vector")
      self._batch_size = array_ops.size(start_tokens)
      if self._end_token.get_shape().ndims != 0:
          raise ValueError("end_token must be a scalar")
      self._start_inputs = self._embedding_fn(self._start_tokens)
  
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 GreedyEmbeddingHelper object from inherited base classes: Helper with example: obj = GreedyEmbeddingHelper(embedding, start_tokens, end_token)