WOLFRAM

Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how
Wolfram Language & System Documentation Center

InputPorts

is an option to specify the number, names or shapes of input ports for some neural net layers.

Details
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
See Also
Related Guides
History
Cite this Page

InputPorts

is an option to specify the number, names or shapes of input ports for some neural net layers.

Details

  • InputPorts is typically used in layers that support an arbitrary number of input ports, such as ThreadingLayer , CatenateLayer , DotLayer and PlaceholderLayer .
  • Typical settings for InputPorts include:
  • Automatic infer number of ports and their shapes from NetChain or NetGraph connectivity
    n n ports with default names and unspecified shapes
    {"name1","name2",} explicit port names with unspecified shapes
    {shape1,shape2,} default port names with specified shapes or encoders
    <|"name1"shape1,|> explicit port names with specified shapes or encoders
  • Shape specifications for each port include:
  • "Real" a single real number
    "Integer" a single integer
    Restricted ["Integer",n] an integer between 1 and n
    n a vector of length n
    {n1,n2,} an array of dimensions n1×n2×
    "Varying" a vector whose length is variable
    {"Varying",n2,n3,} an array whose first dimension is variable and remaining dimensions are n2×n3×
    NetEncoder [] an encoder

Examples

open all close all

Basic Examples  (1)

By default, multi-input layers such as ThreadingLayer have an undefined number of input ports:

Use InputPorts to create a ThreadingLayer with three ports having default names and unspecified shapes:

Scope  (3)

Create a CatenateLayer with two inputs having explicit names and unspecified shapes:

Create a PlaceholderLayer with four inputs having default names and specified shapes:

Create a DotLayer with two inputs having explicit names and specified shapes:

Wolfram Research (2020), InputPorts, Wolfram Language function, https://reference.wolfram.com/language/ref/InputPorts.html.

Text

Wolfram Research (2020), InputPorts, Wolfram Language function, https://reference.wolfram.com/language/ref/InputPorts.html.

CMS

Wolfram Language. 2020. "InputPorts." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/InputPorts.html.

APA

Wolfram Language. (2020). InputPorts. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/InputPorts.html

BibTeX

@misc{reference.wolfram_2025_inputports, author="Wolfram Research", title="{InputPorts}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/InputPorts.html}", note=[Accessed: 08-January-2026]}

BibLaTeX

@online{reference.wolfram_2025_inputports, organization={Wolfram Research}, title={InputPorts}, year={2020}, url={https://reference.wolfram.com/language/ref/InputPorts.html}, note=[Accessed: 08-January-2026]}

Top [フレーム]

AltStyle によって変換されたページ (->オリジナル) /