Merge pull request #35498 from lgeiger:cleanup-fwd-compat-tests

PiperOrigin-RevId: 288339675
Change-Id: Id0b0bc64655cb52ab5dd5252528ec978dc1b9675
This commit is contained in:
TensorFlower Gardener 2020-01-06 11:38:33 -08:00
commit 87cab44823
5 changed files with 101 additions and 111 deletions

View File

@ -23,7 +23,6 @@ import itertools
import numpy as np import numpy as np
from tensorflow.compiler.tests import xla_test from tensorflow.compiler.tests import xla_test
from tensorflow.python.compat import compat
from tensorflow.python.framework import dtypes from tensorflow.python.framework import dtypes
from tensorflow.python.framework import errors from tensorflow.python.framework import errors
from tensorflow.python.ops import array_ops from tensorflow.python.ops import array_ops
@ -1113,7 +1112,6 @@ class BinaryOpsTest(xla_test.XLATestCase):
def testBatchMatMulBroadcast(self): def testBatchMatMulBroadcast(self):
"""Tests broadcasting behavior of BatchMatMul.""" """Tests broadcasting behavior of BatchMatMul."""
with compat.forward_compatibility_horizon(2019, 4, 26):
# [2, 3] @ [1, 3, 4] -> [1, 2, 4] # [2, 3] @ [1, 3, 4] -> [1, 2, 4]
self._testBinary( self._testBinary(
math_ops.matmul, math_ops.matmul,
@ -1126,8 +1124,7 @@ class BinaryOpsTest(xla_test.XLATestCase):
self._testBinary( self._testBinary(
math_ops.matmul, math_ops.matmul,
np.array([[[10, 20, 30], [11, 21, 31]]], dtype=np.float32), np.array([[[10, 20, 30], [11, 21, 31]]], dtype=np.float32),
np.array([[1, 2, 3, 4], [2, 4, 6, 8], [3, 6, 9, 12]], np.array([[1, 2, 3, 4], [2, 4, 6, 8], [3, 6, 9, 12]], dtype=np.float32),
dtype=np.float32),
expected=np.array([[[140, 280, 420, 560], [146, 292, 438, 584]]], expected=np.array([[[140, 280, 420, 560], [146, 292, 438, 584]]],
dtype=np.float32)) dtype=np.float32))
# [2, 1, 3] @ [3, 1] -> [2, 1, 1] # [2, 1, 3] @ [3, 1] -> [2, 1, 1]

View File

@ -20,7 +20,6 @@ from __future__ import print_function
from absl.testing import parameterized from absl.testing import parameterized
from tensorflow.core.protobuf import config_pb2 from tensorflow.core.protobuf import config_pb2
from tensorflow.python.compat import compat
from tensorflow.python.data.experimental.ops import prefetching_ops from tensorflow.python.data.experimental.ops import prefetching_ops
from tensorflow.python.data.kernel_tests import test_base from tensorflow.python.data.kernel_tests import test_base
from tensorflow.python.data.ops import dataset_ops from tensorflow.python.data.ops import dataset_ops
@ -420,7 +419,6 @@ class CopyToDeviceTest(test_base.DatasetTestBase, parameterized.TestCase):
if not test_util.is_gpu_available(): if not test_util.is_gpu_available():
self.skipTest("No GPU available") self.skipTest("No GPU available")
with compat.forward_compatibility_horizon(2018, 8, 4):
host_dataset = dataset_ops.Dataset.range(10) host_dataset = dataset_ops.Dataset.range(10)
device_dataset = host_dataset.apply( device_dataset = host_dataset.apply(
prefetching_ops.copy_to_device("/gpu:0", source_device="/cpu:0")) prefetching_ops.copy_to_device("/gpu:0", source_device="/cpu:0"))

View File

@ -25,7 +25,6 @@ from tensorflow.core.protobuf import device_properties_pb2
from tensorflow.core.protobuf import rewriter_config_pb2 from tensorflow.core.protobuf import rewriter_config_pb2
from tensorflow.core.protobuf import saver_pb2 from tensorflow.core.protobuf import saver_pb2
from tensorflow.python.client import session from tensorflow.python.client import session
from tensorflow.python.compat import compat
from tensorflow.python.framework import constant_op from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops from tensorflow.python.framework import ops
@ -1457,7 +1456,6 @@ class LayoutOptimizerTest(test.TestCase):
@test_util.deprecated_graph_mode_only @test_util.deprecated_graph_mode_only
def testBinaryOpSecondPort(self): def testBinaryOpSecondPort(self):
with compat.forward_compatibility_horizon(2019, 6, 7):
if test.is_gpu_available(cuda_only=True): if test.is_gpu_available(cuda_only=True):
output = _model_with_second_port() output = _model_with_second_port()

View File

@ -23,7 +23,6 @@ import time
import numpy as np import numpy as np
from tensorflow.python.client import session from tensorflow.python.client import session
from tensorflow.python.compat import compat
from tensorflow.python.eager import context from tensorflow.python.eager import context
from tensorflow.python.framework import constant_op from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes from tensorflow.python.framework import dtypes
@ -375,7 +374,6 @@ class GatherNdTest(test.TestCase):
@test_util.run_in_graph_and_eager_modes @test_util.run_in_graph_and_eager_modes
def testGatherNdResourceVariable(self): def testGatherNdResourceVariable(self):
with compat.forward_compatibility_horizon(2019, 4, 30):
with self.cached_session(): with self.cached_session():
v = resource_variable_ops.ResourceVariable( v = resource_variable_ops.ResourceVariable(
constant_op.constant([[1, 2], [3, 4], [5, 6]])) constant_op.constant([[1, 2], [3, 4], [5, 6]]))

View File

@ -20,7 +20,6 @@ from __future__ import print_function
from absl.testing import parameterized from absl.testing import parameterized
from tensorflow.python.compat import compat
from tensorflow.python.framework import constant_op from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes from tensorflow.python.framework import dtypes
from tensorflow.python.framework import test_util from tensorflow.python.framework import test_util
@ -85,7 +84,6 @@ class RegexFullMatchOpTest(test.TestCase):
@test_util.run_deprecated_v1 @test_util.run_deprecated_v1
def testStaticRegexFullMatchDelegation(self): def testStaticRegexFullMatchDelegation(self):
with compat.forward_compatibility_horizon(2018, 11, 20):
with self.cached_session(): with self.cached_session():
input_tensor = constant_op.constant("foo", dtypes.string) input_tensor = constant_op.constant("foo", dtypes.string)
pattern = "[a-z]*" pattern = "[a-z]*"
@ -96,5 +94,6 @@ class RegexFullMatchOpTest(test.TestCase):
op_vec = string_ops.regex_full_match(input_tensor, pattern_tensor) op_vec = string_ops.regex_full_match(input_tensor, pattern_tensor)
self.assertTrue(op_vec.name.startswith("RegexFullMatch"), op.name) self.assertTrue(op_vec.name.startswith("RegexFullMatch"), op.name)
if __name__ == "__main__": if __name__ == "__main__":
test.main() test.main()