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

Function get_node_weights

graphlearn/python/c/py_wrapper.h:180–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180PyObject* get_node_weights(LookupNodesResponse* res) {
181 npy_intp shape[1];
182 shape[0] = res->Size();
183 PyArray_Descr* descr = PyArray_DescrFromType(NPY_FLOAT32);
184 PyObject* obj = PyArray_Zeros(1, shape, descr, 0);
185 PyArrayObject* np_array = reinterpret_cast<PyArrayObject*>(obj);
186 memcpy(PyArray_DATA(np_array), res->Weights(),
187 res->Size() * FLOAT32_BYTES);
188 return obj;
189}
190
191PyObject* get_node_labels(LookupNodesResponse* res) {
192 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