deepmd.backend.backend
Module Contents
Classes
General backend class. |
- class deepmd.backend.backend.Backend[source]
Bases:
deepmd.utils.plugin.PluginVariant
,make_plugin_registry
('backend'
)General backend class.
Examples
>>> @Backend.register("tf") >>> @Backend.register("tensorflow") >>> class TensorFlowBackend(Backend): ... pass
- class Feature(*args, **kwds)[source]
Bases:
enum.Flag
Feature flag to indicate whether the backend supports certain features.
- abstract property entry_point_hook: Callable[[argparse.Namespace], None][source]
The entry point hook of the backend.
- abstract property deep_eval: Type[deepmd.infer.deep_eval.DeepEvalBackend][source]
The Deep Eval backend of the backend.
- Returns:
type
[DeepEvalBackend
]The Deep Eval backend of the backend.
- abstract property neighbor_stat: Type[deepmd.utils.neighbor_stat.NeighborStat][source]
The neighbor statistics of the backend.
- Returns:
type
[NeighborStat
]The neighbor statistics of the backend.
- abstract property serialize_hook: Callable[[str], dict][source]
The serialize hook to convert the model file to a dictionary.
- abstract property deserialize_hook: Callable[[str, dict], None][source]
The deserialize hook to convert the dictionary to a model file.
- name: ClassVar[str] = 'Unknown'[source]
The formal name of the backend.
To be consistent, this name should be also registered in the plugin system.
- features: ClassVar[Backend.Feature][source]
The features of the backend.
- suffixes: ClassVar[List[str]] = [][source]
The supported suffixes of the saved model.
The first element is considered as the default suffix.
- static get_backends() Dict[str, Type[Backend]] [source]
Get all the registered backend names.
- Returns:
list
all the registered backends
- static get_backends_by_feature(feature: Backend) Dict[str, Type[Backend]] [source]
Get all the registered backend names with a specific feature.
- Parameters:
- feature
Backend.Feature
the feature flag
- feature
- Returns:
list
all the registered backends with the feature