mirror of
https://github.com/ml-explore/mlx.git
synced 2025-09-18 18:28:12 +08:00
Fix buffer protocol buffer size designation (#1010)
This commit is contained in:

committed by
GitHub

parent
090ff659dc
commit
ef5f7d1aea
@@ -104,7 +104,7 @@ extern "C" inline int getbuffer(PyObject* obj, Py_buffer* view, int flags) {
|
||||
view->internal = info;
|
||||
view->buf = a.data<void>();
|
||||
view->itemsize = a.itemsize();
|
||||
view->len = a.size();
|
||||
view->len = a.nbytes();
|
||||
view->readonly = false;
|
||||
if ((flags & PyBUF_FORMAT) == PyBUF_FORMAT) {
|
||||
view->format = const_cast<char*>(info->format.c_str());
|
||||
|
Reference in New Issue
Block a user