| 1794 | |
| 1795 | |
| 1796 | class EagerSessionWarner(object): |
| 1797 | |
| 1798 | def __getattr__(self, attr): |
| 1799 | raise AttributeError( |
| 1800 | "Trying to access properties or call methods on the result of " |
| 1801 | "self.session(), self.cached_session(), etc while eager execution " |
| 1802 | "is enabled. If you're porting this test case to TF 2.0, either " |
| 1803 | "adapt the test to work with eager execution or insert a call to " |
| 1804 | "tf.disable_eager_execution() in the main() function of this test " |
| 1805 | "file.") |
| 1806 | |
| 1807 | |
| 1808 | @tf_export("test.TestCase") |