MCPcopy Create free account
hub / github.com/alibaba/graph-learn / get_sampling_node_ids

Function get_sampling_node_ids

graphlearn/python/c/py_wrapper.h:420–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

418}
419
420PyObject* get_sampling_node_ids(SamplingResponse* res) {
421 int32_t size = res->TotalNeighborCount();
422 npy_intp shape[1];
423 shape[0] = size;
424 PyArray_Descr* descr = PyArray_DescrFromType(NPY_INT64);
425 PyObject* obj = PyArray_Zeros(1, shape, descr, 0);
426 PyArrayObject* np_array = reinterpret_cast<PyArrayObject*>(obj);
427 memcpy(reinterpret_cast<int64_t*>(PyArray_DATA(np_array)),
428 res->GetNeighborIds(), size * INT64_BYTES);
429 return obj;
430}
431
432PyObject* get_sampling_edge_ids(SamplingResponse* res) {
433 int32_t size = res->TotalNeighborCount();

Callers 1

init_client_moduleFunction · 0.85

Calls 2

TotalNeighborCountMethod · 0.80
GetNeighborIdsMethod · 0.80

Tested by

no test coverage detected