DeepLearning - Maple Programming Help

Home : Support : Online Help : Programming : DeepLearning Package : Tensors : DeepLearning/Tensor

DeepLearning

 Tensor
 tensor object for DeepLearning computation

Description

 • A Tensor is an object representing a node in a DataflowGraph.
 • A Tensor corresponds to a partially-defined computation which, when executed in a Session, produces a concrete instance of multidimensional data.
 • By performing mathematical or other operations with Tensors, you are implicitly creating additional Tensors and extending the computation graph.
 • All Tensors have a datatype and a shape. The datatype is always known. The shape may be either fully or partially specified when the Tensor is created.

Properties of Tensors

 • The following commands query properties of a Tensor.

Elementwise Operations on Tensors

 • The following functions operate elementwise on a Tensor.

Matrix Operations with Tensors

 • The following functions operate on Tensors as matrices.

Other Operations on Tensors

Examples

Create a Variable Tensor

 > $\mathrm{with}\left(\mathrm{DeepLearning}\right):$
 > $V≔\mathrm{Variable}\left(\left[1.5,7.2,2.3\right],\mathrm{datatype}={\mathrm{float}}_{8}\right)$
 ${V}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: Variable:0}}\\ {\mathrm{Shape: \left[3\right]}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (1)

Create a Placeholder Tensor

 > $P≔\mathrm{Placeholder}\left({\mathrm{float}}_{4},\left[3,2\right]\right)$
 ${P}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: Placeholder:0}}\\ {\mathrm{Shape: \left[3, 2\right]}}\\ {\mathrm{Data Type: float\left[4\right]}}\end{array}\right]$ (2)

Create a Constant Tensor

 > $C≔\mathrm{Constant}\left(⟨⟨0.4,0.7⟩|⟨0.7,-0.3⟩⟩\right)$
 ${C}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: Const:0}}\\ {\mathrm{Shape: \left[2, 2\right]}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (3)

Compatibility

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