Skip to content

Commit

Permalink
- addressing github issue #1198 (reverse_sequence only accepts int64)
Browse files Browse the repository at this point in the history
Change: 116671488
  • Loading branch information
A. Unique TensorFlower authored and tensorflower-gardener committed Mar 9, 2016
1 parent 439a269 commit 484a80c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tensorflow/python/ops/rnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ def _reverse_seq(input_seq, lengths):
# Join into (time, batch_size, depth)
s_joined = array_ops.pack(input_seq)

# TODO(schuster, ebrevdo): Remove cast when reverse_sequence takes int32
if lengths is not None:
lengths = math_ops.to_int64(lengths)

# Reverse along dimension 0
s_reversed = array_ops.reverse_sequence(s_joined, lengths, 0, 1)
# Split again into list
Expand Down

0 comments on commit 484a80c

Please sign in to comment.