Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 05454c6

Browse files
committed
Fix error in seq2seq ops after changing to enumerate
1 parent b0e7758 commit 05454c6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

skflow/ops/seq2seq_ops.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,14 @@ def rnn_decoder(decoder_inputs, initial_state, cell, scope=None):
9393
states, sampling_states = [initial_state], [initial_state]
9494
outputs, sampling_outputs = [], []
9595
with tf.op_scope([decoder_inputs, initial_state], "training"):
96-
for i in enumerate(decoder_inputs):
97-
inp = decoder_inputs[i]
96+
for i, inp in enumerate(decoder_inputs):
9897
if i > 0:
9998
tf.get_variable_scope().reuse_variables()
10099
output, new_state = cell(inp, states[-1])
101100
outputs.append(output)
102101
states.append(new_state)
103102
with tf.op_scope([initial_state], "sampling"):
104-
for i in enumerate(decoder_inputs):
103+
for i, _ in enumerate(decoder_inputs):
105104
if i == 0:
106105
sampling_outputs.append(outputs[i])
107106
sampling_states.append(states[i])

0 commit comments

Comments
 (0)