GetVariable - Maple Help

DeepLearning

 GetVariable
 fetch reference to new or existing Tensor Variable

 Calling Sequence GetVariable(nm,opts)

Parameters

 nm - string; name of the variable to retrieve opts - zero or more options as specified below

Options

 • datatype = one of string,truefalse,integer[4],integer[8],float[4],float[8],complex[4], or complex[8]
 The value of option datatype specifies the type of data this Tensor will hold. By default, the datatype is inferred from the initial data val.
 • shape = list(nonnegint)
 Specifies the shape of the variable.

Description

 • The GetVariable(nm,opts) command retrieves a reference to a Tensor variable in the active dataflow graph with name nm.
 • This function is part of the DeepLearning package, so it can be used in the short form GetVariable(..) only after executing the command with(DeepLearning). However, it can always be accessed through the long form of the command by using DeepLearning[GetVariable](..).

Examples

 > $\mathrm{with}\left(\mathrm{DeepLearning}\right):$
 > $V≔\mathrm{Variable}\left(\left[2.0\right],\mathrm{datatype}=\mathrm{float}\left[8\right],\mathrm{name}="foo"\right)$
 ${V}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: foo:0}}\\ {\mathrm{Shape: undefined}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (1)

Compatibility

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