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

Method N_v_of_group

easygraph/classes/hypergraph.py:1050–1065  ·  view source on GitHub ↗

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

(self, e_idx: int, group_name: str)

Source from the content-addressed store, hash-verified

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.
1052
1053 .. note::
1054 The ``e_idx`` must be in the range of [0, :func:`num_e_of_group`).
1055
1056 Args:
1057 ``e_idx`` (``int``): The index of the hyperedge.
1058 ``group_name`` (``str``): The name of the specified hyperedge group.
1059 """
1060 assert (
1061 group_name in self.group_names
1062 ), f"The specified {group_name} is not in existing hyperedge groups."
1063 assert e_idx < self.num_e_of_group(group_name)
1064 v_indices = self.H_T_of_group(group_name)[e_idx]._indices()[0]
1065 return v_indices.clone()
1066
1067 # =====================================================================================
1068 # spectral-based convolution/smoothing

Callers 3

nbr_v_of_groupMethod · 0.95
N_vMethod · 0.95
test_N_groupFunction · 0.80

Calls 3

num_e_of_groupMethod · 0.95
H_T_of_groupMethod · 0.95
cloneMethod · 0.45

Tested by 1

test_N_groupFunction · 0.64