deepmd.backend.backend#
Classes#
General backend class. |
Module Contents#
- 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
- static get_backends() dict[str, type[Backend]][source]#
Get all the registered backend names.
- Returns:
listall 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:
listall the registered backends with the feature
- static detect_backend_by_model(filename: str) type[Backend][source]#
Detect the backend of the given model file.
- Parameters:
- filename
str The model file name
- filename
- class Feature(*args, **kwds)[source]#
Bases:
enum.FlagFeature flag to indicate whether the backend supports certain features.
- 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.
- abstractmethod is_available() bool[source]#
Check if the backend is available.
- Returns:
- bool
Whether the backend is available.
- property entry_point_hook: Callable[[argparse.Namespace], None][source]#
- Abstractmethod:
The entry point hook of the backend.
- property deep_eval: type[deepmd.infer.deep_eval.DeepEvalBackend][source]#
- Abstractmethod:
The Deep Eval backend of the backend.
- Returns:
type[DeepEvalBackend]The Deep Eval backend of the backend.
- property neighbor_stat: type[deepmd.utils.neighbor_stat.NeighborStat][source]#
- Abstractmethod:
The neighbor statistics of the backend.
- Returns:
type[NeighborStat]The neighbor statistics of the backend.