Fill - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

# Online Help

###### All Products    Maple    MapleSim

DeepLearning

 Fill
 define a placeholder for a Tensor
 Ones
 create a Tensor filled with ones
 Zeros
 create a Tensor filled with zeros

 Calling Sequence Fill(shape,val,opts) Ones(shape,opts) Ones(t,opts) Zeros(shape,opts) Zeros(t,opts)

Parameters

 val - numeric quantity shape - list, dimensions of the output Tensor t - Tensor opts - (optional) 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. If a Tensor t was provided as input, the default value of datatype is the datatype of t; otherwise, the default is float[4].
 • 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 Fill(shape,val,opts) command creates a Tensor in the active dataflow graph with shape shape filled with the scalar value val.
 • The Ones(shape,opts) and Zeros(shape,opts) commands behave similarly but create Tensors whose whose entries are 1 and 0, respectively. If x is a Tensor, the val of the resulting Tensor matches x.
 • If t is a Tensor, the commands Ones(t,opts) and Zeros(t,opts) create Tensors whose whose shape is identical to t but whose entries are 1 and 0, respectively.
 • These functions are part of the DeepLearning package, so they can can be used in the short form Fill(..) only after executing the command with(DeepLearning). However,  can always be accessed through the long form of the command by using DeepLearning[Fill](..).

Examples

 > $\mathrm{with}\left(\mathrm{DeepLearning}\right):$
 > $\mathrm{T1}≔\mathrm{Fill}\left(\left[2,3\right],0.75\right)$
 ${\mathrm{T1}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Shape: \left[2, 3\right]}}\\ {\mathrm{Data Type: float\left[4\right]}}\end{array}\right]$ (1)
 > $\mathrm{T2}≔\mathrm{Ones}\left(\mathrm{T1}\right)$
 ${\mathrm{T2}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Shape: \left[2, 3\right]}}\\ {\mathrm{Data Type: float\left[4\right]}}\end{array}\right]$ (2)
 > $\mathrm{T3}≔\mathrm{Zeros}\left(\left[3,4\right],\mathrm{datatype}={\mathrm{float}}_{8}\right)$
 ${\mathrm{T3}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Shape: \left[3, 4\right]}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (3)

Compatibility

 • The DeepLearning[Fill], DeepLearning[Ones] and DeepLearning[Zeros] commands were introduced in Maple 2018.
 • For more information on Maple 2018 changes, see Updates in Maple 2018.

 See Also