Skip to content

Commit 531ba1d

Browse files
drasmusstbekolay
authored andcommitted
Add support for TensorFlow 2.8
1 parent 1cd0956 commit 531ba1d

File tree

5 files changed

+29
-1
lines changed

5 files changed

+29
-1
lines changed

.nengobones.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ docs_conf_py:
5959
doctest_setup:
6060
- import numpy as np
6161
- import tensorflow as tf
62+
sphinx_options:
63+
autodoc_inherit_docstrings: False
6264

6365
travis_yml:
6466
python: 3.8

CHANGES.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,19 @@ Release history
2222
0.4.1 (unreleased)
2323
==================
2424

25+
*Compatible with TensorFlow 2.1 - 2.8*
26+
27+
**Added**
28+
29+
- Added support for TensorFlow 2.8. (`#46`_)
30+
31+
.. _#46: https://github.com/nengo/keras-lmu/pull/46
2532

2633
0.4.0 (August 16, 2021)
2734
=======================
2835

36+
*Compatible with TensorFlow 2.1 - 2.7*
37+
2938
**Added**
3039

3140
- Setting ``kernel_initializer=None`` now removes the dense input kernel. (`#40`_)

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
default_role = "py:obj"
8686
pygments_style = "sphinx"
8787
user_agent = "keras_lmu"
88+
autodoc_inherit_docstrings = False
8889

8990
project = "KerasLMU"
9091
authors = "Applied Brain Research"

keras_lmu/layers.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,15 @@
1111
else:
1212
from keras.layers.recurrent import DropoutRNNCellMixin
1313

14+
if version.parse(tf.__version__) < version.parse(
15+
"2.8.0rc0"
16+
): # pylint: disable=ungrouped-imports
17+
from tensorflow.keras.layers import Layer as BaseRandomLayer
18+
else:
19+
from keras.engine.base_layer import BaseRandomLayer
20+
1421

15-
class LMUCell(DropoutRNNCellMixin, tf.keras.layers.Layer):
22+
class LMUCell(DropoutRNNCellMixin, BaseRandomLayer):
1623
"""
1724
Implementation of LMU cell (to be used within Keras RNN wrapper).
1825

keras_lmu/tests/conftest.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# pylint: disable=missing-docstring
2+
3+
import tensorflow as tf
4+
from packaging import version
5+
6+
7+
def pytest_configure(config):
8+
if version.parse(tf.__version__) >= version.parse("2.7.0"):
9+
tf.debugging.disable_traceback_filtering()

0 commit comments

Comments
 (0)