This function can be called at the beginning of the program (before Tensors,
Graphs or other structures have been created, and before devices have been
initialized. It switches all global behaviors that are different between
TensorFlow 1.x and 2.x to behave as intended for 2.x.
This function is called in the main TensorFlow __init__.py file, user should
not need to call it, except during complex migrations.
[[["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 2024-04-26 UTC."],[],[],null,["# tf.compat.v1.enable_v2_behavior\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/compat/v2_compat.py#L39-L70) |\n\nEnables TensorFlow 2.x behaviors. \n\n tf.compat.v1.enable_v2_behavior()\n\n\u003cbr /\u003e\n\nMigrate to TF2\n--------------\n\n\u003cbr /\u003e\n\n| **Caution:** This API was designed for TensorFlow v1. Continue reading for details on how to migrate from this API to a native TensorFlow v2 equivalent. See the [TensorFlow v1 to TensorFlow v2 migration guide](https://www.tensorflow.org/guide/migrate) for instructions on how to migrate the rest of your code.\n\nThis function is not necessary if you are using TF2. V2 behavior is enabled by\ndefault.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nDescription\n-----------\n\n### Used in the notebooks\n\n| Used in the tutorials |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| - [Pandas DataFrame to Fairness Indicators Case Study](https://www.tensorflow.org/responsible_ai/fairness_indicators/tutorials/Fairness_Indicators_Pandas_Case_Study) - [Migrating tf.summary usage to TF 2.x](https://www.tensorflow.org/tensorboard/migrate) |\n\nThis function can be called at the beginning of the program (before `Tensors`,\n`Graphs` or other structures have been created, and before devices have been\ninitialized. It switches all global behaviors that are different between\nTensorFlow 1.x and 2.x to behave as intended for 2.x.\n\nThis function is called in the main TensorFlow `__init__.py` file, user should\nnot need to call it, except during complex migrations."]]