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

Method N_e

easygraph/classes/hypergraph.py:1001–1015  ·  view source on GitHub ↗

r"""Return the neighbor hyperedges of the specified vertex with ``torch.Tensor`` format. .. note:: The ``v_idx`` must be in the range of [0, :attr:`num_v`). Args: ``v_idx`` (``int``): The index of the vertex.

(self, v_idx: int)

Source from the content-addressed store, hash-verified

999 return self.group_cache[group_name]["D_e_neg_1"]
1000
1001 def N_e(self, v_idx: int) -> torch.Tensor:
1002 r"""Return the neighbor hyperedges of the specified vertex with ``torch.Tensor`` format.
1003
1004 .. note::
1005 The ``v_idx`` must be in the range of [0, :attr:`num_v`).
1006
1007 Args:
1008 ``v_idx`` (``int``): The index of the vertex.
1009 """
1010 assert v_idx < self.num_v
1011 _tmp, e_bias = [], 0
1012 for name in self.group_names:
1013 _tmp.append(self.N_e_of_group(v_idx, name) + e_bias)
1014 e_bias += self.num_e_of_group(name)
1015 return torch.cat(_tmp, dim=0)
1016
1017 def N_e_of_group(self, v_idx: int, group_name: str) -> torch.Tensor:
1018 r"""Return the neighbor hyperedges of the specified vertex of the specified hyperedge group with ``torch.Tensor`` format.

Callers 3

nbr_eMethod · 0.95
test_NFunction · 0.80
test_N_groupFunction · 0.80

Calls 3

N_e_of_groupMethod · 0.95
num_e_of_groupMethod · 0.95
appendMethod · 0.80

Tested by 2

test_NFunction · 0.64
test_N_groupFunction · 0.64