xnn.common.deploy.torchscript.export_torchscript_potential#
- xnn.common.deploy.torchscript.export_torchscript_potential(model, cutoff, path, metadata=None, total_charge=0.0)[source]#
Script a trained model to a standalone
.ptand save it.Wraps
modelinTorchScriptPotential, compiles it withtorch.jit.scriptand writes the archive. The cutoff and thelong_range/dispersionflags are embedded as extra files, alongside any caller metadata, so a consumer can introspect the artifact withoutxnn.- Parameters:
model (torch.nn.Module) – The trained model (optionally LES-wrapped).
cutoff (float) – Neighbor-list cutoff radius to bake in.
path (str) – Destination
.ptpath.metadata (dict or None, optional) – Extra key/value metadata; values are stringified.
total_charge (float, optional) – Net charge of the deployed system (D4 EEQ charges), by default 0.
- Returns:
The
pathwritten.- Return type: