提交 8d710a73 authored 作者: Frederic's avatar Frederic

Better error message

上级 e0f91f59
......@@ -1064,9 +1064,12 @@ CudaNdarray_TakeFrom(CudaNdarray * self, PyObject *args){
Py_DECREF(indices_obj);
Py_DECREF(indices_float32);
} else {
PyErr_SetString(PyExc_TypeError,
"CudaNdarray_TakeFrom: need a CudaNdarray(float32) that"
" is a view from int64 data for indices");
PyObject* py_s = PyObject_Str(indices_obj);
const char* s = PyString_AsString(py_s);
PyErr_Format(PyExc_TypeError,
"CudaNdarray_TakeFrom: need an ndarray of int64 or a"
" CudaNdarray(float32) that is a view from int64 data"
" for indices. Got %s", s);
return NULL;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论