traverse_nn

Traverser utilities for neural networks.

Submodules

flax

Traversal implementation for flax modules.

reset_traverser

A wrapper around flextype.flexdispatch to create an extensible traverser with lazy type matching.

torch

Traversal implementation for PyTorch modules.

torch_utils

PyTorch-specific utils for traverse_nn.

utils

Generic utils for traverse_nn.

Functions

find_layer

Return the first layer of the given type(s) contained in a model.

find_layers

Return all layers of the given type(s) contained in a model.

is_first_layer

A variable whose value is computed dynamically from the current state.

LAYER_COUNT

A variable that maintains global state across all traversal states.

layer_count_traverser

A wrapper around functools.singledispatch to create an extensible traverser.

nn_compose

Compose a custom traverser with neural network traversal functionality.

nn_traverser

A wrapper around flextype.flexdispatch to create an extensible traverser with lazy type matching.

reset_traverser

A wrapper around flextype.flexdispatch to create an extensible traverser with lazy type matching.