tf.compat.v1.get_default_graph

Returns the default graph for the current thread.

Migrate to TF2

get_default_graph does not work with either eager execution or tf.function, and you should not invoke it directly. To migrate code that uses Graph-related functions to TF2, rewrite the code without them. See the migration guide for more description about the behavior and semantic changes between Tensorflow 1 and Tensorflow 2.

Description

The returned graph will be the innermost graph on which a Graph.as_default() context has been entered, or a global default graph if none has been explicitly created.

The default Graph being used in the current thread.