diff options
author | Alexandre Passos <apassos@google.com> | 2018-10-05 16:32:30 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-10-05 16:40:27 -0700 |
commit | 1daaf0fabee1c59af00e14f358d08ac9f5390b9f (patch) | |
tree | b89043c3399e12982ab99c216dada58a8aedcc5d /tensorflow/python/kernel_tests | |
parent | 12443341c1cf1c96fa187ca08dee2f2a9b9f618b (diff) |
Orders non-resource-affecting stateful ops in defuns.
PiperOrigin-RevId: 215985679
Diffstat (limited to 'tensorflow/python/kernel_tests')
-rw-r--r-- | tensorflow/python/kernel_tests/logging_ops_test.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tensorflow/python/kernel_tests/logging_ops_test.py b/tensorflow/python/kernel_tests/logging_ops_test.py index 4beddd00bb..2f19ecc0e6 100644 --- a/tensorflow/python/kernel_tests/logging_ops_test.py +++ b/tensorflow/python/kernel_tests/logging_ops_test.py @@ -306,6 +306,19 @@ class PrintV2Test(test.TestCase): logging_ops.print_v2(tensor) self.assertTrue((expected + "\n") in printed.contents()) + def testPrintsOrderedInDefun(self): + with context.eager_mode(): + + @function.defun + def prints(): + logging_ops.print_v2("A") + logging_ops.print_v2("B") + logging_ops.print_v2("C") + + with self.captureWritesToStream(sys.stderr) as printed: + prints() + self.assertTrue(("A\nB\nC\n") in printed.contents()) + @test_util.run_in_graph_and_eager_modes() def testPrintInDefunWithoutExplicitEvalOfPrint(self): @function.defun |