Remove Keras dependency from tfe test.

PiperOrigin-RevId: 305395022
Change-Id: I6005a1a8d2a1f0da1be23db4a61ebf607fdca1de
This commit is contained in:
Scott Zhu 2020-04-07 20:15:30 -07:00 committed by TensorFlower Gardener
parent 052461853b
commit 54f2c93e37

View File

@ -39,7 +39,6 @@ from tensorflow.python.ops import array_ops
from tensorflow.python.ops import math_ops from tensorflow.python.ops import math_ops
from tensorflow.python.ops import random_ops from tensorflow.python.ops import random_ops
from tensorflow.python.ops import resource_variable_ops from tensorflow.python.ops import resource_variable_ops
from tensorflow.python import keras
class Tests(test.TestCase): class Tests(test.TestCase):
@ -261,10 +260,12 @@ class Tests(test.TestCase):
def testEagerExecute_InvalidType(self): def testEagerExecute_InvalidType(self):
# Test case for GitHub issue 26879. # Test case for GitHub issue 26879.
value = keras.layers.Input((128, 128, 1), dtype="float32") with ops.Graph().as_default():
with self.assertRaisesRegexp(TypeError, a_2_by_2 = constant_op.constant(1.0, shape=[2, 2])
"Expected list for 'values' argument"): m = resource_variable_ops.ResourceVariable(a_2_by_2)
_ = array_ops.stack(value, axis=1) with self.assertRaisesRegexp(TypeError,
"Expected list for 'values' argument"):
_ = array_ops.stack(m, axis=1)
def testGraphResourceVariableRaisesFallback(self): def testGraphResourceVariableRaisesFallback(self):
with ops.Graph().as_default(): with ops.Graph().as_default():