ResetDefaultGraph - Maple Help

DeepLearning

 ResetDefaultGraph
 get the default computation session

 Calling Sequence ResetDefaultGraph()

Description

 • The ResetDefaultGraph() command closes the current default Session and resets the global default graph.
 • Using any Session or Tensor objects previously defined after invoking ResetDefaultGraph() will result in undefined behavior.
 • Note that this command requires that eager execution be turned off beforehand using the SetEagerExecution command.
 • This function is part of the DeepLearning package, so it can be used in the short form ResetDefaultGraph(..) only after executing the command with(DeepLearning). However, it can always be accessed through the long form of the command by using DeepLearning[ResetDefaultGraph]().

Examples

After this reset, t1 and t2 will no longer be defined.

 > $\mathrm{with}\left(\mathrm{DeepLearning}\right):$
 > $\mathrm{SetEagerExecution}\left(\mathrm{false}\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{t1}≔\mathrm{Tensor}\left(\left[1.5,2.0\right]\right)$
 ${\mathrm{t1}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: Const:0}}\\ {\mathrm{Shape: undefined}}\\ {\mathrm{Data Type: float\left[4\right]}}\end{array}\right]$ (2)
 > $\mathrm{t2}≔\mathrm{Tensor}\left(\left[2.5,6.0\right]\right)$
 ${\mathrm{t2}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: Const_1:0}}\\ {\mathrm{Shape: undefined}}\\ {\mathrm{Data Type: float\left[4\right]}}\end{array}\right]$ (3)
 > $\mathrm{sess}≔\mathrm{ResetDefaultGraph}\left(\right)$

Compatibility

 • The DeepLearning[ResetDefaultGraph] command was introduced in Maple 2018.
 • For more information on Maple 2018 changes, see Updates in Maple 2018.
 • The DeepLearning[ResetDefaultGraph] command was updated in Maple 2021.
 • The  option was updated in Maple 2021.