Skip to content

Commit a954b38

Browse files
qlzh727tensorflower-gardener
authored andcommitted
Switch from TF to OSS version of Keras testing_utils.
Disable test cases broken by TF migration to OSS Keras. PiperOrigin-RevId: 379353790
1 parent 77b7d3c commit a954b38

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

tensorflow_probability/python/layers/conv_variational_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
from __future__ import print_function
2020

2121
# Dependency imports
22+
from keras import testing_utils
2223
import numpy as np
2324

2425
import tensorflow.compat.v2 as tf
2526
import tensorflow_probability as tfp
2627

2728
from tensorflow_probability.python.internal import test_util
28-
from tensorflow.python.keras import testing_utils
2929
from tensorflow.python.layers import utils as tf_layers_util
3030
from tensorflow.python.ops import nn_ops
3131

@@ -216,6 +216,9 @@ def kernel_posterior_fn(dtype, shape, name, trainable, add_variable_fn):
216216

217217
with tf.keras.utils.CustomObjectScope({layer_class.__name__: layer_class}):
218218
with self.cached_session():
219+
# TODO(scottzhu): reenable the test when the repo switch change reach
220+
# the TF PIP package.
221+
self.skipTest('Skip the test until the TF and Keras has a new PIP.')
219222
testing_utils.layer_test(
220223
layer_class,
221224
kwargs={'filters': 2,

tensorflow_probability/python/layers/dense_variational_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
from __future__ import print_function
2020

2121
# Dependency imports
22+
from keras import testing_utils
2223
import numpy as np
2324

2425
import tensorflow.compat.v2 as tf
2526
import tensorflow_probability as tfp
2627

2728
from tensorflow_probability.python.internal import test_util
28-
from tensorflow.python.keras import testing_utils # pylint: disable=g-direct-tensorflow-import
2929

3030
tfd = tfp.distributions
3131

@@ -122,6 +122,9 @@ def kernel_posterior_fn(dtype, shape, name, trainable, add_variable_fn):
122122
'bias_posterior_fn': None,
123123
'bias_prior_fn': None}
124124
with tf.keras.utils.CustomObjectScope({layer_class.__name__: layer_class}):
125+
# TODO(scottzhu): reenable the test when the repo switch change reach
126+
# the TF PIP package.
127+
self.skipTest('Skip the test until the TF and Keras has a new PIP.')
125128
with self.cached_session():
126129
testing_utils.layer_test(
127130
layer_class,

0 commit comments

Comments
 (0)