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

Function get_edge_weights

graphlearn/python/c/py_wrapper.h:333–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331}
332
333PyObject* get_edge_weights(LookupEdgesResponse* res) {
334 npy_intp shape[1];
335 shape[0] = res->Size();
336 PyArray_Descr* descr = PyArray_DescrFromType(NPY_FLOAT32);
337 PyObject* obj = PyArray_Zeros(1, shape, descr, 0);
338 PyArrayObject* np_array = reinterpret_cast<PyArrayObject*>(obj);
339 memcpy(PyArray_DATA(np_array), res->Weights(),
340 res->Size() * FLOAT32_BYTES);
341 return obj;
342}
343
344PyObject* get_edge_labels(LookupEdgesResponse* res) {
345 npy_intp shape[1];

Callers 1

init_client_moduleFunction · 0.85

Calls 2

WeightsMethod · 0.80
SizeMethod · 0.45

Tested by

no test coverage detected