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

Method nbr_v

easygraph/classes/graph.py:346–352  ·  view source on GitHub ↗

r"""Return a vertex list of the neighbors of the vertex ``v_idx``. Args: ``v_idx`` (``int``): The index of the vertex.

(self, v_idx: int)

Source from the content-addressed store, hash-verified

344 self._clear_cache()
345
346 def nbr_v(self, v_idx: int) -> Tuple[List[int], List[float]]:
347 r"""Return a vertex list of the neighbors of the vertex ``v_idx``.
348
349 Args:
350 ``v_idx`` (``int``): The index of the vertex.
351 """
352 return self.N_v(v_idx).cpu().numpy().tolist()
353
354 def N_v(self, v_idx: int) -> Tuple[List[int], List[float]]:
355 r"""Return the neighbors of the vertex ``v_idx`` with ``torch.Tensor`` format.

Callers 3

test_nbrFunction · 0.45
test_nbr_groupFunction · 0.45

Calls 1

N_vMethod · 0.95

Tested by 3

test_nbrFunction · 0.36
test_nbr_groupFunction · 0.36