grouping

grouping#

Grouping layers, for chaining sequential computations.

Classes

CheckStructure

A layer that checks the structure of the value passing through it.

CheckedSequential

A group of layers to call sequentially, with known input/output types.

Identity

A layer that returns its input unchanged, without any side effects.

NamedGroup

A layer that names an activation or a sequence of layers.

Sequential

A group of layers to call sequentially.

Functions

inline_anonymous_sequentials(tree)

Inlines instances of Sequential (not subclasses) into parent groups.

inline_groups(tree, parent_filter, child_filter)

Inlines sequential nodes into their parents if possible.

is_anonymous_sequential(tree)

Checks if the type of a node is exactly Sequential, not a named subclass.

is_sequential_or_named(tree)

Checks if a tree is a subclass of Sequential or a NamedGroup.