represents a layer that has no input and produces as output a constant array.


includes options for the initial value of the array or output size.

Details and Options

  • NetArrayLayer is typically used in a NetGraph and allows a learned array to be used as an ordinary input to other layers. Without NetArrayLayer, all layer inputs must ultimately be derived from inputs to the entire net.
  • The array stored by NetArrayLayer will be learned during training.
  • The constant array stored in NetArrayLayer has the same dimensions as the output of NetArrayLayer.
  • NetArrayLayer["Array"->array] can be used to give an explicit value of the constant array.
  • When the constant array is not explicitly specified or is given as Automatic, it is added automatically when NetInitialize or NetTrain is used.
  • NetArrayLayer["Output"->{d1,d2,}] can be used to fix the output size of the layer, which also fixes the size of the constant array.
  • The following training parameter can also be included:
  • LearningRateMultipliersAutomaticlearning rate multipliers for the array
  • NetArrayLayer[][] returns the constant array.
  • The constant array can also be obtained from an initialized NetArrayLayer using NetExtract[layer,"Array"].
  • Options[NetArrayLayer] gives the list of default options to construct the layer. Options[NetArrayLayer[]] gives the list of default options to evaluate the layer on some data.
  • Information[NetArrayLayer[]] gives a report about the layer.
  • Information[NetArrayLayer[],prop] gives the value of the property prop of NetArrayLayer[]. Possible properties are the same as for NetGraph.


open allclose all

Basic Examples  (2)

Create a NetArrayLayer:

Create an initialized NetArrayLayer with output dimensions specified:

Extract the initialized array:

Scope  (1)

Parameters  (1)

"Array"  (1)

Create a NetArrayLayer with a specific initial value for the array:

Embed the layer in a graph that raises the input to a power of the array elementwise:

Possible Issues  (1)

NetArrayLayer cannot accept symbolic arrays:

Wolfram Research (2020), NetArrayLayer, Wolfram Language function,


Wolfram Research (2020), NetArrayLayer, Wolfram Language function,


Wolfram Language. 2020. "NetArrayLayer." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2020). NetArrayLayer. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2024_netarraylayer, author="Wolfram Research", title="{NetArrayLayer}", year="2020", howpublished="\url{}", note=[Accessed: 18-July-2024 ]}


@online{reference.wolfram_2024_netarraylayer, organization={Wolfram Research}, title={NetArrayLayer}, year={2020}, url={}, note=[Accessed: 18-July-2024 ]}