# CatenateLayer

represents a net layer that takes a list of input tensors and catenates them.

represents a net layer that takes a list of input tensors and catenates them at level n.

# Details and Options

• is equivalent to .
• CatenateLayer is typically used inside NetGraph.
• CatenateLayer has an arbitrary number of input ports named 1, 2, etc.
• Within a NetGraph, a CatenateLayer can be connected using a single edge of the form {src1,src2,}catlayer, where catlayer is the name or index of the CatenateLayer, or as multiple separate edges given in the corresponding order, as src1catlayer,src2catlayer,,srcncatlayer.
• CatenateLayer[][{tensor1,tensor2,}] explicitly computes the output given a list of tensori.
• CatenateLayer exposes the following ports for use in NetGraph etc.:
•  1,2,… numeric tensors "Output" a numeric tensor
• For a list of input tensors {tensor1,tensor2,}, the tensori must be of compatible dimensions. If necessary, the tensori are replicated as appropriate in order to make them all the same rank.
• If given, the level n is relative to the first dimension of the tensori with smallest rank.
• When it cannot be inferred from other layers in a larger net, the option "Inputs"{shape1,shape2,} can be used to fix the dimensions of the input tensors to CatenateLayer. Each shape shapei can be one of the following:
•  {d} ord a vector of dimensions d {d1,d2,…} a tensor of dimensions d1×d2×… {"Varying",…} a tensor with a varying initial dimension

# Examples

open allclose all

## Basic Examples(3)

Create a CatenateLayer:

 In[1]:=
 Out[1]=

Create a CatenateLayer that takes two vectors as input and returns a vector:

 In[1]:=
 Out[1]=

Apply this layer to a list of vectors:

 In[2]:=
 Out[2]=

Construct a NetGraph with a CatenateLayer, specifying input sizes:

 In[1]:=
 Out[1]=

Apply the net to input data:

 In[2]:=
 Out[2]=