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

Method N_v

easygraph/classes/graph.py:354–361  ·  view source on GitHub ↗

r"""Return the neighbors of the vertex ``v_idx`` with ``torch.Tensor`` format. Args: ``v_idx`` (``int``): The index of the vertex.

(self, v_idx: int)

Source from the content-addressed store, hash-verified

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.
356
357 Args:
358 ``v_idx`` (``int``): The index of the vertex.
359 """
360 sub_v_set = self.A[v_idx]._indices()[0].clone()
361 return sub_v_set
362
363 def clone(self):
364 r"""Clone the graph."""

Callers 3

nbr_vMethod · 0.95
test_NFunction · 0.45
test_N_groupFunction · 0.45

Calls 1

cloneMethod · 0.45

Tested by 2

test_NFunction · 0.36
test_N_groupFunction · 0.36