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

Function get_sampling_node_degrees

graphlearn/python/c/py_wrapper.h:444–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442}
443
444PyObject* get_sampling_node_degrees(SamplingResponse* res) {
445 int32_t size = res->BatchSize();
446 npy_intp shape[1];
447 shape[0] = res->BatchSize();
448 PyArray_Descr* descr = PyArray_DescrFromType(NPY_INT32);
449 PyObject* obj = PyArray_Zeros(1, shape, descr, 0);
450 PyArrayObject* np_array = reinterpret_cast<PyArrayObject*>(obj);
451 memcpy(reinterpret_cast<int32_t*>(PyArray_DATA(np_array)),
452 res->GetDegrees(), size * INT32_BYTES);
453 return obj;
454}
455
456AggregatingRequest* new_aggregating_request(
457 const std::string& node_type,

Callers 1

init_client_moduleFunction · 0.85

Calls 2

BatchSizeMethod · 0.45
GetDegreesMethod · 0.45

Tested by

no test coverage detected