xnn.gnn.models.aimnet2_foundation.convert_artifact#
- xnn.gnn.models.aimnet2_foundation.convert_artifact(artifact, dtype=None)[source]#
Convert a reference artifact; return the model and the config that rebuilds it.
The body of
from_aimnet_artifact(). The model is built from the returnedConfigthroughAIMNet2.from_config(), so the config plus the transplanted weights rebuild exactly this model, which is how the model hub caches it. The config’ssubtracted_dispersionrecords the D3(BJ) term the published model is served with, when it has one.- Parameters:
artifact (Mapping) – As returned by
load_artifact().dtype (torch.dtype or str, optional) – Final dtype of the model;
Nonekeeps the artifact’s float32.
- Returns:
The converted model and its config.
- Return type:
- Raises:
NotImplementedError – For an architecture outside the xnn AIMNet2 (see the module docstring) or an unexpected tensor in the state dict.