Session - Maple Help

# Online Help

###### All Products    Maple    MapleSim

DeepLearning

 SessionObject
 object for DeepLearning computation session

Description

 • A Session is an object which encapsulates the context in which Tensor objects within a DataflowGraph are evaluated.
 • There can be more than one Session for the same DataflowGraph, and each Session has its own state and resources.

Creating and Using Sessions

 • To obtain the default computation session for the current graph, use the GetDefaultSession command.
 • To obtain a new session, use the Session command.

Operations with Sessions

 • The following functions can be performed with a Session.

Examples

Here we execute the same simple graph (which performs arithmetic with three Tensors) in the default computation session and in a new session.

 > $\mathrm{with}\left(\mathrm{DeepLearning}\right):$
 > $\mathrm{t1}≔\mathrm{Variable}\left(\left[1.5,2.0\right],\mathrm{datatype}=\mathrm{float}\left[8\right]\right)$
 ${\mathrm{t1}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: Variable:0}}\\ {\mathrm{Shape: undefined}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (1)
 > $\mathrm{t2}≔\mathrm{Variable}\left(\left[2.5,6.0\right],\mathrm{datatype}=\mathrm{float}\left[8\right]\right)$
 ${\mathrm{t2}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: Variable:0}}\\ {\mathrm{Shape: undefined}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (2)
 > $\mathrm{t3}≔\mathrm{Variable}\left(\left[7.2,4.2\right],\mathrm{datatype}=\mathrm{float}\left[8\right]\right)$
 ${\mathrm{t3}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: Variable:0}}\\ {\mathrm{Shape: undefined}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (3)

Compatibility

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

 See Also