spark.core.registry#
Attributes#
Registry singleton. |
|
Decorator used to register a new SparkModule. |
|
Decorator used to register a new SparkPayload. |
|
Decorator used to register a new Initializer. |
|
Decorator used to register a new SparkConfig. |
|
Decorator used to register a new ConfigurationValidator. |
|
Classes#
Structured entry for the registry. |
|
Registry for registry_base_type. |
|
Registry object. |
Functions#
|
Module Contents#
- class spark.core.registry.SubRegistry(registry_base_type)[source]#
Bases:
collections.abc.MappingRegistry for registry_base_type.
- Parameters:
registry_base_type (str)
- get(name, default=None)[source]#
Safely retrieves a component entry by name.
- Parameters:
name (str)
default (Any)
- Return type:
RegistryEntry | None
- get_by_cls(cls)[source]#
Safely retrieves a component entry by name.
- Parameters:
cls (type | None)
- Return type:
RegistryEntry | None
- spark.core.registry.create_registry_decorator(sub_registry, base_class_name, base_class_path, base_class_abr=None)[source]#
- Parameters:
sub_registry (SubRegistry)
base_class_name (str)
base_class_path (str)
base_class_abr (str | None)
- spark.core.registry.register_module[source]#
Decorator used to register a new SparkModule. Note that module must inherit from spark.nn.Module (spark.core.module.SparkModule)
- spark.core.registry.register_payload[source]#
Decorator used to register a new SparkPayload. Note that module must inherit from spark.SparkPayload (spark.core.payloads.SparkPayload)
- spark.core.registry.register_initializer[source]#
Decorator used to register a new Initializer. Note that module must inherit from spark.nn.initializers.base.Initializer
- spark.core.registry.register_config[source]#
Decorator used to register a new SparkConfig. Note that module must inherit from spark.nn.BaseConfig (spark.core.config.BaseSparkConfig)