tf.contrib.eager.run_test_in_graph_and_eager_modes( __unused__=None, graph=None, config=None, use_gpu=False, force_gpu=False, reset_test=True, assert_no_eager_garbage=False )
Defined in tensorflow/python/framework/test_util.py
.
Runs the test in both graph and eager modes.
__unused__
: Prevents sliently skipping tests.graph
: Optional graph to use during the returned session.config
: An optional config_pb2.ConfigProto to use to configure the session.use_gpu
: If True, attempt to run as many ops as possible on GPU.force_gpu
: If True, pin all ops to /device:GPU:0
.reset_test
: If True, tearDown and SetUp the test case again.assert_no_eager_garbage
: If True, sets DEBUG_SAVEALL on the garbage collector and asserts that no extra garbage has been created when running the test in eager mode. This will fail if there are reference cycles (e.g. a = []; a.append(a)). Off by default because some tests may create garbage for legitimate reasons (e.g. they define a class which inherits from object
), and because DEBUG_SAVEALL is sticky in some Python interpreters (meaning that tests which rely on objects being collected elsewhere in the unit test file will not work). Additionally, checks that nothing still has a reference to Tensors that the test allocated.Returns a decorator that will run the decorated test function using both a graph and using eager execution.
© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/eager/run_test_in_graph_and_eager_modes