Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for release #1896

Merged
merged 2 commits into from Apr 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion tensorflow/contrib/learn/BUILD
Expand Up @@ -24,7 +24,7 @@ py_library(

py_test(
name = "test_base",
size = "small",
size = "medium",
srcs = ["python/learn/tests/test_base.py"],
srcs_version = "PY2AND3",
deps = [
Expand Down
14 changes: 3 additions & 11 deletions tensorflow/python/kernel_tests/diag_op_test.py
Expand Up @@ -58,7 +58,7 @@ def testInvalidShapeAtEval(self):
tf.batch_matrix_diag(v).eval(feed_dict={v: 0.0})

def testGrad(self):
shapes = ((3,), (18, 4), (1, 9, 4, 8,))
shapes = ((3,), (7, 4))
with self.test_session(use_gpu=self._use_gpu):
for shape in shapes:
x = tf.constant(np.random.rand(*shape), np.float32)
Expand Down Expand Up @@ -115,7 +115,7 @@ def testInvalidShapeAtEval(self):
feed_dict={v: [[0, 1], [1, 0], [0, 0]]})

def testGrad(self):
shapes = ((3, 3), (18, 3, 3), (1, 9, 4, 3, 5, 5))
shapes = ((3, 3), (5, 3, 3))
with self.test_session(use_gpu=self._use_gpu):
for shape in shapes:
x = tf.constant(np.random.rand(*shape), dtype=np.float32)
Expand Down Expand Up @@ -244,22 +244,14 @@ def testRankSixFloatTensor(self):
def testOddRank(self):
w = np.random.rand(2)
x = np.random.rand(2, 2, 2)
y = np.random.rand(2, 2, 2, 2, 2)
z = np.random.rand(2, 2, 2, 2, 2, 2, 2)
self.assertRaises(ValueError, self.diagPartOp, w, np.float32, 0)
self.assertRaises(ValueError, self.diagPartOp, x, np.float32, 0)
self.assertRaises(ValueError, self.diagPartOp, y, np.float32, 0)
self.assertRaises(ValueError, self.diagPartOp, z, np.float32, 0)

def testUnevenDimensions(self):
w = np.random.rand(2, 5)
x = np.random.rand(2, 1, 2, 3)
y = np.random.rand(2, 1, 2, 1, 2, 5)
z = np.random.rand(2, 2, 2, 2, 2, 2, 2, 2)
self.assertRaises(ValueError, self.diagPartOp, w, np.float32, 0)
self.assertRaises(ValueError, self.diagPartOp, x, np.float32, 0)
self.assertRaises(ValueError, self.diagPartOp, y, np.float32, 0)
self.assertRaises(ValueError, self.diagPartOp, z, np.float32, 0)


class DiagGradOpTest(tf.test.TestCase):
Expand All @@ -284,7 +276,7 @@ class DiagGradPartOpTest(tf.test.TestCase):

def testDiagPartGrad(self):
np.random.seed(0)
shapes = ((3,3), (3,3,3,3), (3,3,3,3,3,3))
shapes = ((3,3), (3,3,3,3))
dtypes = (tf.float32, tf.float64)
with self.test_session(use_gpu=False):
errors = []
Expand Down