| 331 | } |
| 332 | |
| 333 | PyObject* 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 | |
| 344 | PyObject* get_edge_labels(LookupEdgesResponse* res) { |
| 345 | npy_intp shape[1]; |
no test coverage detected