Remove @test_util.run_deprecated_v1 in identity_n_op_py_test.py
PiperOrigin-RevId: 324074537 Change-Id: I67dcf1054dced01b36d6e13f5a0471f4467749d2
This commit is contained in:
parent
2fe61b03cd
commit
e891210614
@ -21,43 +21,38 @@ from __future__ import print_function
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
from tensorflow.python.framework import constant_op
|
from tensorflow.python.framework import constant_op
|
||||||
from tensorflow.python.framework import test_util
|
|
||||||
from tensorflow.python.ops import array_ops
|
from tensorflow.python.ops import array_ops
|
||||||
from tensorflow.python.platform import test
|
from tensorflow.python.platform import test
|
||||||
|
|
||||||
|
|
||||||
class IdentityNOpTest(test.TestCase):
|
class IdentityNOpTest(test.TestCase):
|
||||||
|
|
||||||
@test_util.run_deprecated_v1
|
|
||||||
def testInt32String_6(self):
|
def testInt32String_6(self):
|
||||||
with self.cached_session() as sess:
|
value0, value1 = self.evaluate(
|
||||||
[value0, value1] = sess.run(
|
array_ops.identity_n([[1, 2, 3, 4, 5, 6],
|
||||||
array_ops.identity_n([[1, 2, 3, 4, 5, 6],
|
[b"a", b"b", b"C", b"d", b"E", b"f", b"g"]]))
|
||||||
[b"a", b"b", b"C", b"d", b"E", b"f", b"g"]]))
|
|
||||||
self.assertAllEqual(np.array([1, 2, 3, 4, 5, 6]), value0)
|
self.assertAllEqual(np.array([1, 2, 3, 4, 5, 6]), value0)
|
||||||
self.assertAllEqual(
|
self.assertAllEqual(
|
||||||
np.array([b"a", b"b", b"C", b"d", b"E", b"f", b"g"]), value1)
|
np.array([b"a", b"b", b"C", b"d", b"E", b"f", b"g"]), value1)
|
||||||
|
|
||||||
@test_util.run_deprecated_v1
|
|
||||||
def testInt32_shapes(self):
|
def testInt32_shapes(self):
|
||||||
with self.cached_session() as sess:
|
inp0 = constant_op.constant([10, 20, 30, 40, 50, 60], shape=[2, 3])
|
||||||
inp0 = constant_op.constant([10, 20, 30, 40, 50, 60], shape=[2, 3])
|
inp1 = constant_op.constant([11, 21, 31, 41, 51, 61], shape=[3, 2])
|
||||||
inp1 = constant_op.constant([11, 21, 31, 41, 51, 61], shape=[3, 2])
|
inp2 = constant_op.constant(
|
||||||
inp2 = constant_op.constant(
|
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], shape=[5, 3])
|
||||||
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], shape=[5, 3])
|
value0, value1, value2 = self.evaluate(
|
||||||
[value0, value1,
|
array_ops.identity_n([inp0, inp1, inp2]))
|
||||||
value2] = sess.run(array_ops.identity_n([inp0, inp1, inp2]))
|
|
||||||
self.assertAllEqual(np.array([[10, 20, 30], [40, 50, 60]]), value0)
|
self.assertAllEqual(np.array([[10, 20, 30], [40, 50, 60]]), value0)
|
||||||
self.assertAllEqual(np.array([[11, 21], [31, 41], [51, 61]]), value1)
|
self.assertAllEqual(np.array([[11, 21], [31, 41], [51, 61]]), value1)
|
||||||
self.assertAllEqual(
|
self.assertAllEqual(
|
||||||
np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], [13, 14, 15]]),
|
np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], [13, 14, 15]]),
|
||||||
value2)
|
value2)
|
||||||
|
|
||||||
@test_util.run_deprecated_v1
|
|
||||||
def testString(self):
|
def testString(self):
|
||||||
source = [b"A", b"b", b"C", b"d", b"E", b"f"]
|
source = [b"A", b"b", b"C", b"d", b"E", b"f"]
|
||||||
with self.cached_session() as sess:
|
[value] = self.evaluate(array_ops.identity_n([source]))
|
||||||
[value] = sess.run(array_ops.identity_n([source]))
|
|
||||||
self.assertAllEqual(source, value)
|
self.assertAllEqual(source, value)
|
||||||
|
|
||||||
def testIdentityShape(self):
|
def testIdentityShape(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user