deepmd.pt.model.network.utils#
Functions#
| Aggregate rows in data by specifying the owners. |
| Get the index mapping for edge graph and angle graph, ready in aggregate or index_select. |
Module Contents#
- deepmd.pt.model.network.utils.aggregate(data: torch.Tensor, owners: torch.Tensor, average: bool = True, num_owner: int | None = None) torch.Tensor[source]#
Aggregate rows in data by specifying the owners.
- Parameters:
- Returns:
- output: [
num_owner,feature_dim]
- output: [
- deepmd.pt.model.network.utils.get_graph_index(nlist: torch.Tensor, nlist_mask: torch.Tensor, a_nlist_mask: torch.Tensor, nall: int, use_loc_mapping: bool = True) tuple[torch.Tensor, torch.Tensor][source]#
Get the index mapping for edge graph and angle graph, ready in aggregate or index_select.
- Parameters:
- nlist
nfxnlocxnnei Neighbor list. (padded neis are set to 0)
- nlist_mask
nfxnlocxnnei Masks of the neighbor list. real nei 1 otherwise 0
- a_nlist_mask
nfxnlocxa_nnei Masks of the neighbor list for angle. real nei 1 otherwise 0
- nall
The number of extended atoms.
- nlist
- Returns:
- edge_index2
xn_edge - n2e_indexn_edge
Broadcast indices from node(i) to edge(ij), or reduction indices from edge(ij) to node(i).
- n_ext2e_indexn_edge
Broadcast indices from extended node(j) to edge(ij).
- angle_index3
xn_angle - n2a_indexn_angle
Broadcast indices from extended node(j) to angle(ijk).
- eij2a_indexn_angle
Broadcast indices from extended edge(ij) to angle(ijk), or reduction indices from angle(ijk) to edge(ij).
- eik2a_indexn_angle
Broadcast indices from extended edge(ik) to angle(ijk).
- edge_index2