Clears the default graph stack and resets the global default graph. NOTE: The default graph is a property of the current thread. This function applies only to the current thread. Calling this function while a `tf.compat.v1.Session` or `tf.compat.v1.InteractiveSession` is active will result
()
| 5917 | |
| 5918 | @tf_export(v1=["reset_default_graph"]) |
| 5919 | def reset_default_graph(): |
| 5920 | """Clears the default graph stack and resets the global default graph. |
| 5921 | |
| 5922 | NOTE: The default graph is a property of the current thread. This |
| 5923 | function applies only to the current thread. Calling this function while |
| 5924 | a `tf.compat.v1.Session` or `tf.compat.v1.InteractiveSession` is active will |
| 5925 | result in undefined |
| 5926 | behavior. Using any previously created `tf.Operation` or `tf.Tensor` objects |
| 5927 | after calling this function will result in undefined behavior. |
| 5928 | Raises: |
| 5929 | AssertionError: If this function is called within a nested graph. |
| 5930 | """ |
| 5931 | if not _default_graph_stack.is_cleared(): |
| 5932 | raise AssertionError("Do not use tf.reset_default_graph() to clear " |
| 5933 | "nested graphs. If you need a cleared graph, " |
| 5934 | "exit the nesting and create a new graph.") |
| 5935 | _default_graph_stack.reset() |
| 5936 | |
| 5937 | |
| 5938 | @tf_export(v1=["get_default_graph"]) |
nothing calls this directly
no test coverage detected