aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/keras/_impl/keras/layers/lstm_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/python/keras/_impl/keras/layers/lstm_test.py')
-rw-r--r--tensorflow/python/keras/_impl/keras/layers/lstm_test.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/tensorflow/python/keras/_impl/keras/layers/lstm_test.py b/tensorflow/python/keras/_impl/keras/layers/lstm_test.py
index 8d359bf17c..f43d90fec8 100644
--- a/tensorflow/python/keras/_impl/keras/layers/lstm_test.py
+++ b/tensorflow/python/keras/_impl/keras/layers/lstm_test.py
@@ -156,9 +156,8 @@ class LSTMLayerTest(test.TestCase):
activity_regularizer='l1')
layer.build((None, None, 2))
self.assertEqual(len(layer.losses), 3)
- x = keras.backend.variable(np.ones((2, 3, 2)))
- layer(x)
- self.assertEqual(len(layer.get_losses_for(x)), 1)
+ layer(keras.backend.variable(np.ones((2, 3, 2))))
+ self.assertEqual(len(layer.losses), 4)
def test_constraints_LSTM(self):
embedding_dim = 4
@@ -176,9 +175,9 @@ class LSTMLayerTest(test.TestCase):
recurrent_constraint=r_constraint,
bias_constraint=b_constraint)
layer.build((None, None, embedding_dim))
- self.assertEqual(layer.cell.kernel.constraint, k_constraint)
- self.assertEqual(layer.cell.recurrent_kernel.constraint, r_constraint)
- self.assertEqual(layer.cell.bias.constraint, b_constraint)
+ self.assertEqual(layer.kernel.constraint, k_constraint)
+ self.assertEqual(layer.recurrent_kernel.constraint, r_constraint)
+ self.assertEqual(layer.bias.constraint, b_constraint)
def test_with_masking_layer_LSTM(self):
layer_class = keras.layers.LSTM