tf.test.with_eager_op_as_function

Adds methods that call original methods with eager_op_as_function enabled.

Example:

@test_util.with_eager_op_as_function class SessionTest(test.TestCase):

def testEnabledForEagerOpAsFunction(self): ...

@disable_eager_op_as_function("b/xyzabc") def testDisabledForEagerOpAsFunction(self): ...

Generated class:

class SessionTest(test.TestCase):

def testEnabledForEagerOpAsFunction(self): ...

def testEnabledForEagerOpAsFunctionWithEagerOpAsFunctionEnabled(self): // Enable run_eager_op_as_function // Reset context testEnabledForEagerOpAsFunction(self) // Disable run_eager_op_as_function // Reset context

def testDisabledForEagerOpAsFunction(self): ...

cls class to decorate.
only_as_function whether to run all the tests in the TestCase in eager mode and in eager_op_as_function mode. By default it will run all tests in both modes. When only_as_function=True tests will not be run in eager mode.

cls with new test methods added.