Module fast_transformers.attention_registry

Allow for the dynamic registration of new attention implementations.

This module provides a Registry implementation that other modules can use to register attention implementations for the builders.

Expand source code
#
# Copyright (c) 2020 Idiap Research Institute, http://www.idiap.ch/
# Written by Angelos Katharopoulos <angelos.katharopoulos@idiap.ch>
#

"""Allow for the dynamic registration of new attention implementations.

This module provides a Registry implementation that other modules can use to
register attention implementations for the builders.
"""

from .registry import \
    AttentionRegistry, \
    RecurrentAttentionRegistry, \
    RecurrentCrossAttentionRegistry
from .spec import Spec, Choice, Optional, Int, Float, Bool, Callable, \
    EventDispatcherInstance

Sub-modules

fast_transformers.attention_registry.registry
fast_transformers.attention_registry.spec

Spec instances allow to describe and check the type and value of parameters.