MCPcopy Create free account
hub / github.com/easy-graph/Easy-Graph / N_v

Method N_v

easygraph/classes/hypergraph.py:1034–1048  ·  view source on GitHub ↗

r"""Return the neighbor vertices of the specified hyperedge with ``torch.Tensor`` format. .. note:: The ``e_idx`` must be in the range of [0, :attr:`num_e`). Args: ``e_idx`` (``int``): The index of the hyperedge.

(self, e_idx: int)

Source from the content-addressed store, hash-verified

1032 return e_indices.clone()
1033
1034 def N_v(self, e_idx: int) -> torch.Tensor:
1035 r"""Return the neighbor vertices of the specified hyperedge with ``torch.Tensor`` format.
1036
1037 .. note::
1038 The ``e_idx`` must be in the range of [0, :attr:`num_e`).
1039
1040 Args:
1041 ``e_idx`` (``int``): The index of the hyperedge.
1042 """
1043 assert e_idx < self.num_e
1044 for name in self.group_names:
1045 if e_idx < self.num_e_of_group(name):
1046 return self.N_v_of_group(e_idx, name)
1047 else:
1048 e_idx -= self.num_e_of_group(name)
1049
1050 def N_v_of_group(self, e_idx: int, group_name: str) -> torch.Tensor:
1051 r"""Return the neighbor vertices of the specified hyperedge of the specified hyperedge group with ``torch.Tensor`` format.

Callers 1

nbr_vMethod · 0.95

Calls 2

num_e_of_groupMethod · 0.95
N_v_of_groupMethod · 0.95

Tested by

no test coverage detected