DeepLearning - Maple Programming Help

Home : Support : Online Help : Programming : DeepLearning Package : Managing Sessions : DeepLearning/GetDefaultSession

DeepLearning

 GetDefaultSession
 get the default computation session

 Calling Sequence GetDefaultSession()

Description

 • The GetDefaultSession() command returns a Session object corresponding to the default session for the current thread.
 • This function is part of the DeepLearning package, so it can be used in the short form GetDefaultSession(..) only after executing the command with(DeepLearning). However, it can always be accessed through the long form of the command by using DeepLearning[GetDefaultSession](..).

Examples

 > $\mathrm{with}\left(\mathrm{DeepLearning}\right):$
 > $\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: \left[2\right]}}\\ {\mathrm{Data Type: float\left[4\right]}}\end{array}\right]$ (1)
 > $\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: \left[2\right]}}\\ {\mathrm{Data Type: float\left[4\right]}}\end{array}\right]$ (2)
 > $\mathrm{sess}≔\mathrm{GetDefaultSession}\left(\right)$
 ${\mathrm{sess}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Session}}\\ {\mathrm{}}\end{array}\right]$ (3)
 > $\mathrm{sess}:-\mathrm{Run}\left(\mathrm{t1}\mathrm{t2}\right)$
 $\left[\begin{array}{c}{3.75000000000000}\\ {12.}\end{array}\right]$ (4)

Compatibility

 • The DeepLearning[GetDefaultSession] command was introduced in Maple 2018.