collapses up to nesting level n.
Details and Options
- NetFlatten[net] will flatten nested nets at any level, including within operators such as NetMapOperator and NetFoldOperator.
Examplesopen allclose all
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).
Wolfram Language. 2018. "NetFlatten." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/NetFlatten.html.
Wolfram Language. (2018). NetFlatten. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NetFlatten.html