¿Cómo devolver una matriz C a Python?
Escribí una función de extensión Python / C que fue llamada por Python. ¿Cómo puedo devolver una matriz 2d int [] [] a Python?
static PyObject* inference_function(PyObject *self, PyObject *args)
{
PyObject* doc_lst;
int K,V;
double alpha,beta;
int n_iter;
if (!PyArg_ParseTuple(args, "Oiiddi", &doc_lst, &K,&V, &alpha,&beta,&n_iter))
{
printf("传入参数错误!\n");
return NULL;
}
return Py_BuildValue("i", 1);
}