Skip to content

Commit 033c894

Browse files
committed
[docs] seq2seq TF1.0
1 parent 8a3080b commit 033c894

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tensorlayer/layers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3839,6 +3839,7 @@ class Seq2Seq(Layer):
38393839
38403840
Examples
38413841
----------
3842+
>>> from tensorlayer.layers import *
38423843
>>> batch_size = 32
38433844
>>> encode_seqs = tf.placeholder(dtype=tf.int64, shape=[batch_size, None], name="encode_seqs")
38443845
>>> decode_seqs = tf.placeholder(dtype=tf.int64, shape=[batch_size, None], name="decode_seqs")
@@ -3871,7 +3872,7 @@ class Seq2Seq(Layer):
38713872
... return_seq_2d = True,
38723873
... name = 'seq2seq')
38733874
>>> net_out = DenseLayer(net, n_units=10000, act=tf.identity, name='output')
3874-
>>> e_loss = tl.cost.cross_entropy_seq_with_mask(logits=net_out.outputs, target_seqs=target_seqs, input_mask=target_mask, return_details=False)
3875+
>>> e_loss = tl.cost.cross_entropy_seq_with_mask(logits=net_out.outputs, target_seqs=target_seqs, input_mask=target_mask, return_details=False, name='cost')
38753876
>>> y = tf.nn.softmax(net_out.outputs)
38763877
>>> net_out.print_params(False)
38773878

0 commit comments

Comments
 (0)