remove v1 decorator
PiperOrigin-RevId: 324043196 Change-Id: Ic99e03747dc720d1d1299fdc4773ed0b527d40b3
This commit is contained in:
parent
43154abec0
commit
b487d50b36
@ -23,6 +23,7 @@ from tensorflow.core.protobuf import config_pb2
|
|||||||
from tensorflow.python.client import session
|
from tensorflow.python.client import session
|
||||||
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 test_util
|
from tensorflow.python.framework import test_util
|
||||||
from tensorflow.python.ops import gen_io_ops
|
from tensorflow.python.ops import gen_io_ops
|
||||||
from tensorflow.python.ops import io_ops
|
from tensorflow.python.ops import io_ops
|
||||||
@ -55,22 +56,22 @@ class ShardedFileOpsTest(test.TestCase):
|
|||||||
|
|
||||||
class ShapeInferenceTest(test.TestCase):
|
class ShapeInferenceTest(test.TestCase):
|
||||||
|
|
||||||
@test_util.run_deprecated_v1
|
|
||||||
def testRestoreV2WithSliceInput(self):
|
def testRestoreV2WithSliceInput(self):
|
||||||
|
with ops.Graph().as_default():
|
||||||
op = io_ops.restore_v2("model", ["var1", "var2"], ["", "3 4 0,1:-"],
|
op = io_ops.restore_v2("model", ["var1", "var2"], ["", "3 4 0,1:-"],
|
||||||
[dtypes.float32, dtypes.float32])
|
[dtypes.float32, dtypes.float32])
|
||||||
self.assertEqual(2, len(op))
|
self.assertEqual(2, len(op))
|
||||||
self.assertFalse(op[0].get_shape().is_fully_defined())
|
self.assertFalse(op[0].get_shape().is_fully_defined())
|
||||||
self.assertEqual([1, 4], op[1].get_shape())
|
self.assertEqual([1, 4], op[1].get_shape())
|
||||||
|
|
||||||
@test_util.run_deprecated_v1
|
|
||||||
def testRestoreV2NumSlicesNotMatch(self):
|
def testRestoreV2NumSlicesNotMatch(self):
|
||||||
|
with ops.Graph().as_default():
|
||||||
with self.assertRaises(ValueError):
|
with self.assertRaises(ValueError):
|
||||||
io_ops.restore_v2("model", ["var1", "var2", "var3"], ["", "3 4 0,1:-"],
|
io_ops.restore_v2("model", ["var1", "var2", "var3"], ["", "3 4 0,1:-"],
|
||||||
[dtypes.float32, dtypes.float32])
|
[dtypes.float32, dtypes.float32])
|
||||||
|
|
||||||
@test_util.run_deprecated_v1
|
|
||||||
def testRestoreSlice(self):
|
def testRestoreSlice(self):
|
||||||
|
with ops.Graph().as_default():
|
||||||
op = gen_io_ops.restore_slice("model", "var", "3 4 0,1:-", dtypes.float32)
|
op = gen_io_ops.restore_slice("model", "var", "3 4 0,1:-", dtypes.float32)
|
||||||
self.assertEqual([1, 4], op.get_shape())
|
self.assertEqual([1, 4], op.get_shape())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user