Skip to content

Commit 648ce97

Browse files
committed
Undefined names can raise NameError at runtime --> tensorlayer/seq2seq-chatbot#1
1 parent ae3a6fc commit 648ce97

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tensorlayer/layers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5973,9 +5973,9 @@ def sampled_loss(inputs, labels):
59735973
cell = cell_creator()
59745974
if num_layers > 1:
59755975
try: # TF1.0
5976-
cell = tf.contrib.rnn.MultiRNNCell([single_cell] * num_layers)
5976+
cell = tf.contrib.rnn.MultiRNNCell([cell] * num_layers)
59775977
except:
5978-
cell = tf.nn.rnn_cell.MultiRNNCell([single_cell] * num_layers)
5978+
cell = tf.nn.rnn_cell.MultiRNNCell([cell] * num_layers)
59795979

59805980
# ============== Seq Decode Layer ============
59815981
# The seq2seq function: we use embedding for the input and attention.

tensorlayer/prepro.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ def channel_shift(x, intensity, is_random=False, channel_index=2):
994994
# x = np.rollaxis(x, 0, channel_index+1)
995995
# return x
996996

997-
def channel_shift_multi(x, intensity, channel_index=2):
997+
def channel_shift_multi(x, intensity, is_random=False, channel_index=2):
998998
"""Shift the channels of images with the same arguments, randomly or non-randomly, see `numpy.rollaxis <https://docs.scipy.org/doc/numpy/reference/generated/numpy.rollaxis.html>`_ .
999999
Usually be used for image segmentation which x=[X, Y], X and Y should be matched.
10001000

0 commit comments

Comments
 (0)