Diagonal - Maple Help

DeepLearning,Tensor,Diagonal

construct diagonal tensor

 Calling Sequence Diagonal(x,opts)

Parameters

 x - Tensor opts - zero of more options as specified 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 Diagonal(x,opts) command returns a diagonal Tensor with a given diagonal values.
 • Given a diagonal x, this operation returns a Tensor with the diagonal and everything else padded with zeros.

Examples

 > $\mathrm{with}\left(\mathrm{DeepLearning}\right):$
 > $V≔⟨-35.0,65.0,41.0⟩$
 ${V}{≔}\left[\begin{array}{c}{-35.0}\\ {65.0}\\ {41.0}\end{array}\right]$ (1)
 > $t≔\mathrm{Constant}\left(V\right)$
 ${t}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: none}}\\ {\mathrm{Shape: undefined}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (2)
 > $\mathrm{Diagonal}\left(t\right)$
 $\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: none}}\\ {\mathrm{Shape: undefined}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (3)

Compatibility

 • The DeepLearning,Tensor,Diagonal command was introduced in Maple 2018.