Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.

Commit 5f9dd2d

Browse files
tgale96copybara-github
authored andcommitted
Removing layers cache to avoid issues with TF2 check on initialization.
PiperOrigin-RevId: 334365253
1 parent ba8c10d commit 5f9dd2d

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

tensor2tensor/layers/common_layers.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,9 @@
3737
from tensorflow.python.ops import inplace_ops
3838

3939

40-
_cached_layers = None
41-
42-
4340
# TODO(lukaszkaiser): remove this function when not needed any more.
4441
def layers():
4542
"""Get the layers module good for TF 1 and TF 2 work for now."""
46-
global _cached_layers
47-
if _cached_layers is not None:
48-
return _cached_layers
4943
layers_module = None
5044
try:
5145
layers_module = tf.layers
@@ -58,7 +52,6 @@ def layers():
5852
layers_module = tf.keras.layers
5953
except ImportError:
6054
pass
61-
_cached_layers = layers_module
6255
return layers_module
6356

6457

0 commit comments

Comments
 (0)