Skip to content

Commit 7912cc1

Browse files
author
TensorFlow Recommenders Authors
committed
cleanup of deprecated test methods
PiperOrigin-RevId: 716071485
1 parent c60e42e commit 7912cc1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tensorflow_recommenders/layers/feature_interaction/dcn_test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ def test_one_input(self):
5050
self.assertAllClose(np.asarray([[0.16, 0.32, 0.48]]), output)
5151

5252
def test_unsupported_input_dim(self):
53-
with self.assertRaisesRegexp(ValueError,
53+
with self.assertRaisesRegex(ValueError,
5454
r"dimension mismatch"):
5555
x0 = np.random.random((12, 5))
5656
x = np.random.random((12, 7))
5757
layer = Cross()
5858
layer(x0, x)
5959

6060
def test_invalid_diag_scale(self):
61-
with self.assertRaisesRegexp(ValueError,
61+
with self.assertRaisesRegex(ValueError,
6262
r"`diag_scale` should be non-negative"):
6363
x0 = np.asarray([[0.1, 0.2, 0.3]]).astype(np.float32)
6464
x = np.asarray([[0.4, 0.5, 0.6]]).astype(np.float32)

tensorflow_recommenders/layers/feature_interaction/dot_interaction_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def test_valid_input(self):
6464
f13, f23, 0]]), output)
6565

6666
def test_non_matching_dimensions(self):
67-
with self.assertRaisesRegexp(ValueError, r"dimensions must be equal"):
67+
with self.assertRaisesRegex(ValueError, r"dimensions must be equal"):
6868
feature1 = np.asarray([[0.1, 0.2, 0.3]]).astype(np.float32)
6969
feature2 = np.asarray([[2.0, -1.0, 1.0]]).astype(np.float32)
7070
feature3 = np.asarray([[0.0, 1.0]]).astype(np.float32)

0 commit comments

Comments
 (0)