Skip to content

Commit ddef04c

Browse files
Issue #498 - Deprecation Warning Fix in tl.layers.RNNLayer with inspect (#574)
* Issue #498 Fix * Update CHANGELOG.md * Fix for Python 2.7
1 parent 1625226 commit ddef04c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ To release a new version, please update the changelog as followed:
8181
### Removed
8282

8383
### Fixed
84+
- Issue #498 - Deprecation Warning Fix in `tl.layers.RNNLayer` with `inspect` (by @DEKHTIARJonathan in #574)
8485
- Issue #498 - Deprecation Warning Fix in `tl.files` with truth value of an empty array is ambiguous (by @DEKHTIARJonathan in #575)
8586

8687
### Security

tensorlayer/layers/recurrent.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import inspect
44

55
import tensorflow as tf
6+
from tensorflow.python.util.tf_inspect import getfullargspec
67

78
from .. import _logging as logging
89
from .core import *
@@ -204,7 +205,7 @@ def __init__(
204205
# for input_ in tf.split(1, num_steps, inputs)]
205206
# outputs, state = rnn.rnn(cell, inputs, initial_state=self._initial_state)
206207
outputs = []
207-
if 'reuse' in inspect.getargspec(cell_fn.__init__).args:
208+
if 'reuse' in getfullargspec(cell_fn.__init__).args:
208209
self.cell = cell = cell_fn(num_units=n_hidden, reuse=tf.get_variable_scope().reuse, **cell_init_args)
209210
else:
210211
self.cell = cell = cell_fn(num_units=n_hidden, **cell_init_args)

0 commit comments

Comments
 (0)