This function is not necessary if you are using TF2. V2 behavior is enabled by
default.
Description
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.
[null,null,["Last updated 2023-10-06 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.14.0/tensorflow/python/compat/v2_compat.py#L39-L80) |\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\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."]]