(self, cell, helper, initial_state, output_layer=None)
Initialize BasicDecoder.

    Args:
      cell: An `RNNCell` instance.
      helper: A `Helper` instance.
      initial_state: A (possibly nested tuple of...) tensors and TensorArrays.
        The initial state of the RNNCell.
      output_layer: (Optional) An instance of `tf.compat.v1.layers.Layer`, i.e.,
        `tf.compat.v1.layers.Dense`. Optional layer to apply to the RNN output
        prior to storing the result or sampling.

    Raises:
      TypeError: if `cell`, `helper` or `output_layer` have an incorrect type.
Initialize BasicDecoder.
Initialize BasicDecoder .
def __init__(self, cell, helper, initial_state, output_layer=None):
    """Initialize BasicDecoder.

    Args:
      cell: An `RNNCell` instance.
      helper: A `Helper` instance.
      initial_state: A (possibly nested tuple of...) tensors and TensorArrays.
        The initial state of the RNNCell.
      output_layer: (Optional) An instance of `tf.compat.v1.layers.Layer`, i.e.,
        `tf.compat.v1.layers.Dense`. Optional layer to apply to the RNN output
        prior to storing the result or sampling.

    Raises:
      TypeError: if `cell`, `helper` or `output_layer` have an incorrect type.
    """
    contrib_rnn.assert_like_rnncell("cell", cell)
    if not isinstance(helper, Helper):
      raise TypeError("helper must be a Helper, received: %s" % type(helper))
    if (output_layer is not None and
        not isinstance(output_layer, tf.layers.Layer)):
      raise TypeError("output_layer must be a Layer, received: %s" %
                      type(output_layer))
    self._cell = cell
    self._helper = helper
    self._initial_state = initial_state
    self._output_layer = output_layer
def __init__ ( self , cell , helper , initial_state , output_layer = None ) : contrib_rnn . assert_like_rnncell ( "cell" , cell ) if not isinstance ( helper , Helper ) : raise TypeError ( "helper must be a Helper, received: %s" % type ( helper ) ) if ( output_layer is not None and not isinstance ( output_layer , tf . layers . Layer ) ) : raise TypeError ( "output_layer must be a Layer, received: %s" % type ( output_layer ) ) self . _cell = cell self . _helper = helper self . _initial_state = initial_state self . _output_layer = output_layer