Spec-Zone.ru › TensorFlow

tf.compat.v1.enable_v2_behavior

Enables TensorFlow 2.x behaviors.

tf.compat.v1.enable_v2_behavior()

Migrate to TF2

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 for instructions on how to migrate the rest of your code.

This function is not necessary if you are using TF2. V2 behavior is enabled by default.

Description

Used in the notebooks

Used in the tutorials
  • Pandas DataFrame to Fairness Indicators Case Study
  • Migrating tf.summary usage to TF 2.x

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.

© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/compat/v1/enable_v2_behavior

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API