class_docstr: Base abstract class that allows the user to customize sampling.
class_docstr_tok: ["Base","abstract","class","that","allows","the","user","to","customize","sampling","."]
docstr: Initializer.
  
  Args:
    initialize_fn: callable that returns `(finished, next_inputs)`
      for the first iteration.
    sample_fn: callable that takes `(time, outputs, state)`
      and emits tensor `sample_ids`.
    next_inputs_fn: callable that takes `(time, outputs, state, sample_ids)`
      and emits `(finished, next_inputs, next_state)`.
docstr_tok: ["Initializer",".","Args",":","initialize_fn",":","callable","that","returns","`","(","finished",",","next_inputs",")","`","for","the","first","iteration",".","sample_fn",":","callable","that","takes","`","(","time",",","outputs",",","state",")","`","and","emits","tensor","`","sample_ids","`",".","next_inputs_fn",":","callable","that","takes","`","(","time",",","outputs",",","state",",","sample_ids",")","`","and","emits","`","(","finished",",","next_inputs",",","next_state",")","`","."]
code: def __init__(self, initialize_fn, sample_fn, next_inputs_fn):
      """Initializer.
  
      Args:
        initialize_fn: callable that returns `(finished, next_inputs)`
          for the first iteration.
        sample_fn: callable that takes `(time, outputs, state)`
          and emits tensor `sample_ids`.
        next_inputs_fn: callable that takes `(time, outputs, state, sample_ids)`
          and emits `(finished, next_inputs, next_state)`.
      """
      self._initialize_fn = initialize_fn
      self._sample_fn = sample_fn
      self._next_inputs_fn = next_inputs_fn
      self._batch_size = None
  
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 CustomHelper object from inherited base classes: Helper with example: obj = CustomHelper(initialize_fn, sample_fn, next_inputs_fn)