Skip to content

Commit d4af112

Browse files
author
Amit Patankar
authored
Merge pull request tensorflow#9207 from av8ramit/cherrypicks
Cherrypick
2 parents 0d20f74 + c44e87d commit d4af112

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

tensorflow/python/ops/gradients_test.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -562,14 +562,16 @@ def testInt64Indices(self):
562562
def testWarnings(self):
563563
# TODO(gunan) Reenable after this issue is fixed:
564564
# https://github.com/google/protobuf/issues/2812
565-
if sys.version_info < (3, 6):
566-
# Smaller than the threshold: no warning.
567-
c_sparse = ops.IndexedSlices(
568-
array_ops.placeholder(dtypes.float32),
569-
array_ops.placeholder(dtypes.int32), constant([4, 4, 4, 4]))
570-
with warnings.catch_warnings(record=True) as w:
571-
math_ops.multiply(c_sparse, 1.0)
572-
self.assertEqual(0, len(w))
565+
if sys.version_info >= (3, 6):
566+
self.skipTest("Skipped test for Python 3.6+")
567+
568+
# Smaller than the threshold: no warning.
569+
c_sparse = ops.IndexedSlices(
570+
array_ops.placeholder(dtypes.float32),
571+
array_ops.placeholder(dtypes.int32), constant([4, 4, 4, 4]))
572+
with warnings.catch_warnings(record=True) as w:
573+
math_ops.multiply(c_sparse, 1.0)
574+
self.assertEqual(0, len(w))
573575

574576
# Greater than or equal to the threshold: warning.
575577
c_sparse = ops.IndexedSlices(

0 commit comments

Comments
 (0)