WOLFRAM

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

NetFlatten [net]

collapses nested NetChain and NetGraph objects within net.

NetFlatten [net,n]

collapses up to nesting level n.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Properties & Relations  
See Also
Tech Notes
Related Guides
History
Cite this Page

NetFlatten [net]

collapses nested NetChain and NetGraph objects within net.

NetFlatten [net,n]

collapses up to nesting level n.

Details and Options

Examples

open all close all

Basic Examples  (2)

Flatten nested chains:

Flatten nested graphs:

Scope  (3)

Turn a NetChain with nested NetGraph into a unique NetGraph :

Collapse nested NetChain and NetGraph up to level 1:

Turn a flat NetGraph into a NetChain :

Properties & Relations  (3)

NetFlatten flattens nested nets, including within operators.

Construct an operator that contains nested chains:

The inner net of the NetMapOperator has been flattened:

NetFlatten yields a NetChain for a NetGraph that is fully flat:

NetFlatten yields a NetGraph for a NetChain that contains a nested NetGraph :

Wolfram Research (2018), NetFlatten, Wolfram Language function, https://reference.wolfram.com/language/ref/NetFlatten.html (updated 2019).

Text

Wolfram Research (2018), NetFlatten, Wolfram Language function, https://reference.wolfram.com/language/ref/NetFlatten.html (updated 2019).

CMS

Wolfram Language. 2018. "NetFlatten." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/NetFlatten.html.

APA

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

BibTeX

@misc{reference.wolfram_2025_netflatten, author="Wolfram Research", title="{NetFlatten}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/NetFlatten.html}", note=[Accessed: 16-November-2025]}

BibLaTeX

@online{reference.wolfram_2025_netflatten, organization={Wolfram Research}, title={NetFlatten}, year={2019}, url={https://reference.wolfram.com/language/ref/NetFlatten.html}, note=[Accessed: 16-November-2025]}

Top [フレーム]

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