Skip to content

Commit bfffb58

Browse files
dengyueyun666Jonathan DEKHTIAR
authored andcommitted
Update recurrent.py (#676)
* Update recurrent.py * Update CHANGELOG.md * Update recurrent.py * YAPF Cleaning
1 parent df3e2cb commit bfffb58

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ To release a new version, please update the changelog as followed:
144144
- Issue #498 - Deprecation Warning Fix in `tl.files` with truth value of an empty array is ambiguous (by @DEKHTIARJonathan in #575)
145145
- Issue #565 related to `tl.utils.predict` fixed - `np.hstack` problem in which the results for multiple batches are stacked along `axis=1` (by @2wins in #566)
146146
- Issue #572 with `tl.layers.DeformableConv2d` fixed (by @DEKHTIARJonathan in #573)
147+
- Issue #664 with `tl.layers.ConvLSTMLayer` fixed (by @dengyueyun666 in #676)
147148
- Typo of the document of ElementwiseLambdaLayer (by @zsdonghao in #588)
148149
- Error in `tl.layers.TernaryConv2d` fixed - self.inputs not defined (by @DEKHTIARJonathan in #658)
149150
- Deprecation warning fixed in `tl.layers.binary._compute_threshold()` (by @DEKHTIARJonathan in #658)

tensorlayer/layers/recurrent.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,9 +763,14 @@ def __init__(
763763
self.batch_size = batch_size
764764
outputs = []
765765
self.cell = cell = cell_fn(shape=cell_shape, filter_size=filter_size, num_features=feature_map)
766+
766767
if initial_state is None:
767-
self.initial_state = cell.zero_state(batch_size, dtype=LayersConfig.tf_dtype) # dtype=tf.float32) # 1.2.3
768+
self.initial_state = cell.zero_state(batch_size, dtype=LayersConfig.tf_dtype)
769+
else:
770+
self.initial_state = initial_state
771+
768772
state = self.initial_state
773+
769774
# with tf.variable_scope("model", reuse=None, initializer=initializer):
770775
with tf.variable_scope(name, initializer=initializer) as vs:
771776
for time_step in range(n_steps):

0 commit comments

Comments
 (0)