W3cubDocs

/TensorFlow 2.4

tf.compat.v1.mixed_precision.disable_mixed_precision_graph_rewrite

Disables the mixed precision graph rewrite.

After this is called, the mixed precision graph rewrite will no longer run for new Sessions, and so float32 operations will no longer be converted to float16 in such Sessions. However, any existing Sessions will continue to have the graph rewrite enabled if they were created after enable_mixed_precision_graph_rewrite was called but before disable_mixed_precision_graph_rewrite was called.

This does not undo the effects of loss scaling. Any optimizers wrapped with a LossScaleOptimizer will continue to do loss scaling, although this loss scaling will no longer be useful if the optimizer is used in new Sessions, as the graph rewrite no longer converts the graph to use float16.

This function is useful for unit testing. A unit tests can test using the mixed precision graph rewrite, then disable it so future unit tests continue using float32. If this is done, unit tests should not share a single session, as enable_mixed_precision_graph_rewrite and disable_mixed_precision_graph_rewrite have no effect on existing sessions.

© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.4/api_docs/python/tf/compat/v1/mixed_precision/disable_mixed_precision_graph_rewrite