tf.contrib.seq2seq.Helper

Class Helper

Defined in tensorflow/contrib/seq2seq/python/ops/helper.py.

See the guide: Seq2seq Library (contrib) > Dynamic Decoding

Interface for implementing sampling in seq2seq decoders.

Helper instances are used by BasicDecoder.

Properties

batch_size

Batch size of tensor returned by sample.

Returns a scalar int32 tensor.

sample_ids_dtype

DType of tensor returned by sample.

Returns a DType.

sample_ids_shape

Shape of tensor returned by sample, excluding the batch dimension.

Returns a TensorShape.

Methods

initialize

initialize(name=None)

Returns (initial_finished, initial_inputs).

next_inputs

next_inputs(
    time,
    outputs,
    state,
    sample_ids,
    name=None
)

Returns (finished, next_inputs, next_state).

sample

sample(
    time,
    outputs,
    state,
    name=None
)

Returns sample_ids.
{"cc_re__cc_re__cc_by_3_0": [",\n    state,\n    sample_ids,\n    name=None\n)\n</code></pre>\n<p>Returns <code>(finished, next_inputs, next_state)</code>.</p>\n\n<h3 id=\"sample\"><code>sample</code></h3>\n<pre class=\"prettyprint lang-python\"><code>sample(\n    time,\n    outputs,\n    state,\n    name=None\n)\n</code></pre>\n<p>Returns <code>sample_ids</code>.</p>\n\n  </div>\n  \n\n  \n        \n  \n\n\n\n\n\n\n\n        \n<div class=\"devsite-content-footer nocontent\">\n  \n  \n    <p>Except as otherwise noted, the content of this page is licensed under the <a href=\"https://creativecommons.org/licenses/by/3.0/\">Creative Commons Attribution 3.0 License</a>, and code samples are licensed under the <a href=\"https://www.apache.org/licenses/LICENSE-2.0\">Apache 2.0 License</a>. For details, see our <a href=\"https://developers.google.com/terms/site-policies\">Site Policies</a>. Java is a registered trademark of Oracle and/or its affiliates.</p>\n  \n\n  \n    \n    <p class=\"devsite-content-footer-date\" itemprop=\"datePublished\"\n       content=\"2018-07-11T00:31:14.533710\">\n      \n      Last updated July 11, 2018.\n  "]}