DeepLearning - Maple Programming Help

Home : Support : Online Help : Programming : DeepLearning Package : Tensors : Managing Tensors : DeepLearning/Concatenate

DeepLearning

 Concatenate
 concatenate multiple Tensors

 Calling Sequence Concatenate(L,axis,opts)

Parameters

 L - list or Array of Tensors axis - nonnegint; axis on which to join Tensors opts - zero or 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 Concatenate(L,axis,opts) command concatenates the list of Tensor objects L along the dimension specified by the zero-based index axis.
 • For example, if Tensors T1 and T2 have shape [2,3] and [4,3] respectively, then Concatenate([T1,T2],0) would join T1 and T2 in the first index, producing a Tensor with shape [6,3].
 • This function is part of the DeepLearning package, so it can be used in the short form Concatenate(..) only after executing the command with(DeepLearning). However, it can always be accessed through the long form of the command by using DeepLearning[Concatenate](..).

Examples

 > $\mathrm{with}\left(\mathrm{DeepLearning}\right):$
 > $\mathrm{t1}≔\mathrm{Ones}\left(\left[3,2\right]\right)$
 ${\mathrm{t1}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: ones:0}}\\ {\mathrm{Shape: \left[3, 2\right]}}\\ {\mathrm{Data Type: float\left[4\right]}}\end{array}\right]$ (1)
 > $\mathrm{t2}≔\mathrm{Zeros}\left(\left[3,4\right]\right)$
 ${\mathrm{t2}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: zeros:0}}\\ {\mathrm{Shape: \left[3, 4\right]}}\\ {\mathrm{Data Type: float\left[4\right]}}\end{array}\right]$ (2)
 > $\mathrm{t3}≔\mathrm{Concatenate}\left(\left[\mathrm{t1},\mathrm{t2}\right],1\right)$
 ${\mathrm{t3}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: concat:0}}\\ {\mathrm{Shape: \left[3, 6\right]}}\\ {\mathrm{Data Type: float\left[4\right]}}\end{array}\right]$ (3)
 > $\mathrm{Shape}\left(\mathrm{t3}\right)$
 $\left[{3}{,}{6}\right]$ (4)

Compatibility

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