tf.compat.v1.mixed_precision.disable_mixed_precision_graph_rewrite
bookmark_borderbookmark
Stay organized with collections
Save and categorize content based on your preferences.
Disables the mixed precision graph rewrite.
View aliases
Compat aliases for migration
See
Migration guide for
more details.
tf.compat.v1.train.experimental.disable_mixed_precision_graph_rewrite
tf.compat.v1.mixed_precision.disable_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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-04-26 UTC.
[[["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.mixed_precision.disable_mixed_precision_graph_rewrite\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/training/experimental/mixed_precision.py#L216-L248) |\n\nDisables the mixed precision graph rewrite.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.train.experimental.disable_mixed_precision_graph_rewrite`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/mixed_precision/disable_mixed_precision_graph_rewrite)\n\n\u003cbr /\u003e\n\n tf.compat.v1.mixed_precision.disable_mixed_precision_graph_rewrite()\n\nAfter this is called, the mixed precision graph rewrite will no longer run for\nnew Sessions, and so float32 operations will no longer be converted to float16\nin such Sessions. However, any existing Sessions will continue to have the\ngraph rewrite enabled if they were created after\n`enable_mixed_precision_graph_rewrite` was called but before\n`disable_mixed_precision_graph_rewrite` was called.\n\nThis does not undo the effects of loss scaling. Any optimizers wrapped with a\nLossScaleOptimizer will continue to do loss scaling, although this loss\nscaling will no longer be useful if the optimizer is used in new Sessions, as\nthe graph rewrite no longer converts the graph to use float16.\n\nThis function is useful for unit testing. A unit tests can test using the\nmixed precision graph rewrite, then disable it so future unit tests continue\nusing float32. If this is done, unit tests should not share a single session,\nas `enable_mixed_precision_graph_rewrite` and\n`disable_mixed_precision_graph_rewrite` have no effect on existing sessions."]]