tf.test.with_eager_op_as_function
Stay organized with collections
Save and categorize content based on your preferences.
Adds methods that call original methods with eager_op_as_function enabled.
tf.test.with_eager_op_as_function(
cls=None, only_as_function=False
)
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):
...
Args |
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.
|
Returns |
cls with new test methods added.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2023-03-17 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-03-17 UTC."],[],[]]