xnn.common.models.ops.refresh_ghosts#
- xnn.common.models.ops.refresh_ghosts(x)[source]#
Per-atom rows with the ghost atoms’ rows replaced by their owners’ values.
Under
DomainParallelwithhalo="layer"a process holds its own atoms and copies (ghosts) of the atoms within one cutoff of them. A model that setsrefreshes_ghostscalls this on its node features before every layer that reads its neighbors’ features, so the ghosts carry the values their owners computed and one cutoff of ghosts is enough. Differentiable: the gradients of the ghost rows return to their owners.xunchanged outside a domain decomposition and in scripted code.- Parameters:
x (torch.Tensor) – Per-atom rows
(N, *feature_dims), the process’s own atoms first.- Returns:
xwith its ghost rows refreshed, same shape.- Return type: