Downgrade some @run_v1_only annotations

Some annotations were too coarse grained, whereas others were resolved
with recent fixes.

PiperOrigin-RevId: 225455888
This commit is contained in:
Gaurav Jain 2018-12-13 16:23:09 -08:00 committed by TensorFlower Gardener
parent 63037a9519
commit f5ef72147c
12 changed files with 24 additions and 29 deletions

View File

@ -403,7 +403,6 @@ class KerasCallbacksTest(test.TestCase):
float(keras.backend.get_value(
model.optimizer.lr)) - 0.01 / 4) < keras.backend.epsilon()
@test_util.run_v1_only('b/120545219')
def test_ReduceLROnPlateau(self):
with self.cached_session():
np.random.seed(1337)
@ -675,7 +674,7 @@ class KerasCallbacksTest(test.TestCase):
self.assertEqual(len(loss), 1)
self.assertEqual(loss[0], np.inf)
@test_util.run_v1_only('b/120545219')
@test_util.run_deprecated_v1
def test_TensorBoard(self):
np.random.seed(1337)
@ -779,7 +778,7 @@ class KerasCallbacksTest(test.TestCase):
data_generator(True), len(x_train), epochs=2, callbacks=cbks)
assert os.path.exists(temp_dir)
@test_util.run_v1_only('b/120545219')
@test_util.run_deprecated_v1
def test_TensorBoard_multi_input_output(self):
np.random.seed(1337)
tmpdir = self.get_temp_dir()
@ -851,7 +850,7 @@ class KerasCallbacksTest(test.TestCase):
callbacks=callbacks_factory(histogram_freq=1))
assert os.path.isdir(filepath)
@test_util.run_v1_only('b/120545219')
@test_util.run_deprecated_v1
def test_Tensorboard_histogram_summaries_in_test_function(self):
class FileWriterStub(object):
@ -929,7 +928,7 @@ class KerasCallbacksTest(test.TestCase):
self.assertAllEqual(tsb.writer.steps_seen, [0, 1, 2, 3, 4, 5])
@test_util.run_v1_only('b/120545219')
@test_util.run_deprecated_v1
def test_Tensorboard_histogram_summaries_with_generator(self):
np.random.seed(1337)
tmpdir = self.get_temp_dir()

View File

@ -226,7 +226,6 @@ class TestSequential(keras_parameterized.TestCase):
inner_model.trainable = True
self.assertEqual(len(model.trainable_weights), 4)
@tf_test_util.run_v1_only('b/120545219')
def test_sequential_update_disabling(self):
val_a = np.random.random((10, 4))
val_out = np.random.random((10, 4))

View File

@ -473,7 +473,6 @@ class TrainingTest(keras_parameterized.TestCase):
metrics=['accuracy'],
run_eagerly=testing_utils.should_run_eagerly())
@tf_test_util.run_v1_only('b/120545219')
def test_that_trainable_disables_updates(self):
val_a = np.random.random((10, 4))
val_out = np.random.random((10, 4))
@ -1286,7 +1285,6 @@ class LossMaskingTest(keras_parameterized.TestCase):
class TestDynamicTrainability(keras_parameterized.TestCase):
@tf_test_util.run_v1_only('b/120545219')
def test_trainable_warning(self):
with self.cached_session():
x = np.random.random((5, 3))
@ -1300,7 +1298,6 @@ class TestDynamicTrainability(keras_parameterized.TestCase):
model.train_on_batch(x, y)
self.assertRaises(Warning)
@tf_test_util.run_v1_only('b/120545219')
def test_trainable_argument(self):
with self.cached_session():
x = np.random.random((5, 3))

View File

@ -35,7 +35,6 @@ class KerasIntegrationTest(test.TestCase):
def test_version(self):
self.assertTrue(keras.__version__.endswith('-tf'))
@test_util.run_v1_only('b/120545219')
def test_vector_classification_sequential(self):
with self.cached_session():
np.random.seed(1337)
@ -168,7 +167,6 @@ class KerasIntegrationTest(test.TestCase):
verbose=2)
self.assertGreater(history.history['val_acc'][-1], 0.7)
@test_util.run_v1_only('b/120545219')
def test_video_classification_functional(self):
with self.cached_session():
np.random.seed(1337)
@ -197,7 +195,6 @@ class KerasIntegrationTest(test.TestCase):
verbose=2)
self.assertGreater(history.history['val_acc'][-1], 0.7)
@test_util.run_v1_only('b/120545219')
def test_vector_classification_shared_sequential(self):
# Test that Sequential models that feature internal updates
# and internal losses can be shared.
@ -232,7 +229,6 @@ class KerasIntegrationTest(test.TestCase):
verbose=2)
self.assertGreater(history.history['val_acc'][-1], 0.7)
@test_util.run_v1_only('b/120545219')
def test_vector_classification_shared_model(self):
# Test that functional models that feature internal updates
# and internal losses can be shared.

View File

@ -235,7 +235,7 @@ class LocallyConnected2DLayersTest(test.TestCase):
class LocallyConnectedImplementationModeTest(test.TestCase):
@tf_test_util.run_v1_only('b/120545219')
@tf_test_util.run_deprecated_v1
def test_locallyconnected_implementation(self):
with self.cached_session():
num_samples = 4

View File

@ -321,7 +321,6 @@ class LSTMLayerTest(keras_parameterized.TestCase):
class LSTMLayerGraphOnlyTest(test.TestCase):
@tf_test_util.run_v1_only('b/120545219')
def test_statefulness_LSTM(self):
num_samples = 2
timesteps = 3

View File

@ -253,7 +253,6 @@ def _run_batchnorm_correctness_test(layer, dtype='float32', fused=False):
np.testing.assert_allclose(out.std(), 1.0, atol=1e-1)
@tf_test_util.run_v1_only('b/120545219')
class NormalizationLayersGraphModeOnlyTest(test.TestCase):
def test_shared_batchnorm(self):
@ -328,6 +327,7 @@ class NormalizationLayersGraphModeOnlyTest(test.TestCase):
x2 = model.predict(val_a)
self.assertAllClose(x1, x2, atol=1e-7)
@tf_test_util.run_deprecated_v1
def test_batchnorm_trainable(self):
"""Tests that batchnorm layer is trainable when learning phase is enabled.

View File

@ -99,7 +99,6 @@ class SimpleRNNLayerTest(keras_parameterized.TestCase):
self.assertEqual(layer.cell.recurrent_kernel.constraint, r_constraint)
self.assertEqual(layer.cell.bias.constraint, b_constraint)
@tf_test_util.run_v1_only('b/120545219')
def test_with_masking_layer_SimpleRNN(self):
layer_class = keras.layers.SimpleRNN
inputs = np.random.random((2, 3, 4))

View File

@ -165,7 +165,6 @@ class TimeDistributedTest(test.TestCase):
y = model.predict(np.random.random((10, 3, 2)))
self.assertAllClose(np.mean(y), 0., atol=1e-1, rtol=1e-1)
@tf_test_util.run_v1_only('b/120545219')
def test_TimeDistributed_batchnorm(self):
with self.cached_session():
# test that wrapped BN updates still work.
@ -188,7 +187,6 @@ class TimeDistributedTest(test.TestCase):
# Verify input_map has one mapping from inputs to reshaped inputs.
self.assertEqual(len(td._input_map.keys()), 1)
@tf_test_util.run_v1_only('b/120545219')
def test_TimeDistributed_trainable(self):
# test layers that need learning_phase to be set
x = keras.layers.Input(shape=(3, 2))
@ -203,7 +201,6 @@ class TimeDistributedTest(test.TestCase):
assert len(layer.updates) == 2
assert len(layer.trainable_weights) == 2
@tf_test_util.run_v1_only('b/120545219')
def test_TimeDistributed_with_masked_embedding_and_unspecified_shape(self):
with self.cached_session():
# test with unspecified shape and Embeddings with mask_zero
@ -236,7 +233,6 @@ class TimeDistributedTest(test.TestCase):
self.assertAllEqual(mask_outputs_val[i], ref_mask_val[i])
self.assertIs(mask_outputs[-1], None) # final layer
@tf_test_util.run_v1_only('b/120545219')
def test_TimeDistributed_with_masking_layer(self):
with self.cached_session():
# test with Masking layer

View File

@ -187,7 +187,6 @@ def get_nested_model_3(input_dim, num_classes):
@test_util.run_all_in_graph_and_eager_modes
@test_util.run_v1_only('b/120545219')
class ModelSubclassingTest(test.TestCase):
def test_custom_build(self):
@ -916,7 +915,6 @@ class ModelSubclassingTest(test.TestCase):
self.assertEqual(1, len(model.get_updates_for(x)))
@test_util.run_v1_only('b/120545219')
class GraphSpecificModelSubclassingTests(test.TestCase):
@test_util.run_deprecated_v1

View File

@ -230,7 +230,7 @@ class LoadAndRemapMatrixTest(test.TestCase):
np.reshape(initializing_values, (num_rows, num_cols)),
self.evaluate(remapped_matrix))
@test_util.run_v1_only('b/120545219')
@test_util.run_deprecated_v1
def test_load_and_remap_invalid_remapping(self):
"""Tests that errors are raised when an ID maps to multiple new IDs.
@ -262,7 +262,7 @@ class LoadAndRemapMatrixTest(test.TestCase):
with self.cached_session(), self.assertRaises(errors.UnimplementedError):
self.evaluate(remapped_matrix)
@test_util.run_v1_only('b/120545219')
@test_util.run_deprecated_v1
def test_load_and_remap_incorrect_initializing_values(self):
"""Tests that errors are raised with incorrect number of init values."""
remapped_matrix = gen_checkpoint_ops.load_and_remap_matrix(

View File

@ -29,9 +29,9 @@ from tensorflow.python.ops import variables
from tensorflow.python.platform import test
@test_util.run_v1_only("b/120545219")
class SessionOpsTest(test.TestCase):
@test_util.run_deprecated_v1
def testHandleBasic(self):
with self.cached_session() as sess:
# Return a handle.
@ -46,6 +46,7 @@ class SessionOpsTest(test.TestCase):
y = math_ops.multiply(x, 10)
self.assertEqual(500, sess.run(y, feed_dict={f: h.handle}))
@test_util.run_deprecated_v1
def testHandleEval(self):
with self.cached_session() as sess:
# Return a handle.
@ -58,6 +59,7 @@ class SessionOpsTest(test.TestCase):
# Get the tensor from its handle.
self.assertEqual(50, h.eval())
@test_util.run_deprecated_v1
def testHandleAndValue(self):
with self.cached_session() as sess:
# Return a handle and a value.
@ -71,6 +73,7 @@ class SessionOpsTest(test.TestCase):
self.assertEqual(50, h.eval())
self.assertEqual(500, v)
@test_util.run_deprecated_v1
def testHandleCond(self):
with self.cached_session() as sess:
# Return a handle and a value
@ -91,6 +94,7 @@ class SessionOpsTest(test.TestCase):
self.assertEqual(5000, result)
@test_util.run_deprecated_v1
def testHandleForLoop(self):
with self.cached_session() as sess:
# Initialize a handle.
@ -108,6 +112,7 @@ class SessionOpsTest(test.TestCase):
self.assertEqual(100, h.eval())
@test_util.run_deprecated_v1
def testHandleWhileLoop(self):
with self.cached_session() as sess:
# Initialize a handle.
@ -128,6 +133,7 @@ class SessionOpsTest(test.TestCase):
self.assertEqual(101, h.eval())
@test_util.run_deprecated_v1
def testHandleMover(self):
with self.cached_session() as sess:
# Return a handle.
@ -149,6 +155,7 @@ class SessionOpsTest(test.TestCase):
h = self.evaluate(h)
self.assertEqual(100, sess.run(y, feed_dict={f: h.handle}))
@test_util.run_deprecated_v1
def testHandleDelete(self):
with self.cached_session() as sess:
# Return a handle.
@ -158,6 +165,7 @@ class SessionOpsTest(test.TestCase):
h = session_ops.get_session_handle(c)
self.evaluate(h).delete()
@test_util.run_deprecated_v1
def testHandleDeleteRaw(self):
with self.cached_session() as sess:
# Return a handle.
@ -172,6 +180,7 @@ class SessionOpsTest(test.TestCase):
f, x = session_ops.delete_session_tensor(raw_h)
sess.run(x, feed_dict={f: raw_h})
@test_util.run_deprecated_v1
def testMultiDevices(self):
with self.cached_session() as sess:
with ops.device(test.gpu_device_name()):
@ -190,6 +199,7 @@ class SessionOpsTest(test.TestCase):
b_p: b_handle.handle})
self.assertEqual(3.0, c_handle.eval())
@test_util.run_deprecated_v1
def testHandleGC(self):
with self.cached_session() as sess:
# initial values live on CPU
@ -214,6 +224,7 @@ class SessionOpsTest(test.TestCase):
feed_dict={add_h1: one_handle.handle,
add_h2: x_handle.handle})
@test_util.run_deprecated_v1
def testHandlePlacement(self):
with self.cached_session() as sess:
a = constant_op.constant(1.0)
@ -234,7 +245,7 @@ class SessionOpsTest(test.TestCase):
b_p: b_handle.handle})
self.assertEqual(3.0, c_handle.eval())
@test_util.run_v1_only("b/120545219")
@test_util.run_deprecated_v1
def testFeedOneHandleDirectly(self):
with self.cached_session() as sess:
a = constant_op.constant(10.0)
@ -246,7 +257,7 @@ class SessionOpsTest(test.TestCase):
self.assertAllClose(2500.0, sess.run(d, feed_dict={c: h_c}))
@test_util.run_v1_only("b/120545219")
@test_util.run_deprecated_v1
def testDirectHandleFeedOverlappingWithFetches(self):
with self.cached_session() as sess:
a = constant_op.constant(10.0)
@ -273,6 +284,7 @@ class SessionOpsTest(test.TestCase):
self.assertAllClose(50.0, c_val)
self.assertAllClose(50.0, d_val)
@test_util.run_deprecated_v1
def testFeedTwoHandlesDirectly(self):
with self.cached_session() as sess:
a = constant_op.constant(10.0)
@ -287,7 +299,7 @@ class SessionOpsTest(test.TestCase):
self.assertAllClose(48.0, sess.run(e, feed_dict={c: h_c, d: h_d}))
self.assertAllClose(-48.0, sess.run(e, feed_dict={c: h_d, d: h_c}))
@test_util.run_v1_only("b/120545219")
@test_util.run_deprecated_v1
def testFeedHandleToVariableDirectly(self):
with self.cached_session() as sess:
a = variables.Variable(12.0)