Skip to content

clear_norm_cache

clear_norm_cache() -> None

Drops the cached graph normalizations.

Layers such as GCNConv cache the normalization of a graph without edge weights, and reuse it as long as the same edge_index array is passed. Call this after modifying an edge_index in place.

Source code in mlx_graphs/nn/conv/_norm.py
def clear_norm_cache() -> None:
    """Drops the cached graph normalizations.

    Layers such as :class:`~mlx_graphs.nn.GCNConv` cache the normalization of
    a graph without edge weights, and reuse it as long as the same
    ``edge_index`` array is passed. Call this after modifying an
    ``edge_index`` in place.
    """
    _norm_cache.clear()

from mlx_graphs.nn import clear_norm_cache · mlx_graphs/nn/conv/_norm.py