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 1.x.
User can call this function to disable 2.x behavior during complex migrations.
[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tf.compat.v1.disable_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#L73-L105) |\n\nDisables TensorFlow 2.x behaviors. \n\n tf.compat.v1.disable_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\nUsing this function indicates that your software is not compatible\nwith eager execution and [`tf.function`](../../../tf/function) in TF2.\n\nTo migrate to TF2, rewrite your code to be compatible with eager execution.\nPlease refer to the [migration guide](https://www.tensorflow.org/guide/migrate) for additional resource on the\ntopic.\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| - [Generating Images with BigBiGAN](https://www.tensorflow.org/hub/tutorials/bigbigan_with_tf_hub) - [Generating Images with BigGAN](https://www.tensorflow.org/hub/tutorials/biggan_generation_with_tf_hub) - [Classify Flowers with Transfer Learning](https://www.tensorflow.org/hub/tutorials/image_feature_vector) - [Generating Images with Little Data Using S3GAN](https://www.tensorflow.org/hub/tutorials/s3gan_generation_with_tf_hub) - [Universal Sentence Encoder-Lite demo](https://www.tensorflow.org/hub/tutorials/semantic_similarity_with_tf_hub_universal_encoder_lite) |\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 1.x.\n\nUser can call this function to disable 2.x behavior during complex migrations."]]