Placeholder - Maple Help

# Online Help

###### All Products    Maple    MapleSim

DeepLearning

 Placeholder
 define a placeholder for a Tensor

 Calling Sequence Placeholder(val,shape,opts)

Parameters

 val - type or Tensor shape - (optional) dimensions of the placeholder opts - zero or more options as described below

Options

 • name = string
 The value of option name specifies an optional name for this Tensor to be displayed in output and when visualizing the dataflow graph.

Description

 • The Placeholder(val,shape) command creates a placeholder Tensor in the active dataflow graph.
 • The parameter val can be a type or a Tensor.
 • If val is a type, a value must be supplied for this placeholder when the the graph is executed.
 • 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 Placeholder(..) only after executing the command with(DeepLearning). However, it can always be accessed through the long form of the command by using DeepLearning[Placeholder](..).

Examples

 > $\mathrm{with}\left(\mathrm{DeepLearning}\right):$
 > $\mathrm{SetEagerExecution}\left(\mathrm{false}\right)$
 ${\mathrm{true}}$ (1)
 > $x≔\mathrm{Placeholder}\left(\mathrm{float}\left[8\right]\right)$
 ${x}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: Placeholder:0}}\\ {\mathrm{Shape: undefined}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (2)
 > $y≔3{x}^{2}$
 ${y}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: scalar_mul:0}}\\ {\mathrm{Shape: undefined}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (3)
 > $\mathrm{sess}≔\mathrm{GetDefaultSession}\left(\right)$
 ${\mathrm{sess}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Session}}\\ {\mathrm{}}\end{array}\right]$ (4)
 > $\mathrm{sess}:-\mathrm{Run}\left(y,\left\{x\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{in}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left[1,2,3\right]\right\}\right)$
 $\left[\begin{array}{c}{3.}\\ {12.}\\ {27.}\end{array}\right]$ (5)

Compatibility

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

 See Also