diff --git a/src/numpy_cpp.h b/src/numpy_cpp.h index 0bc2d5c03854..128482c669ec 100644 --- a/src/numpy_cpp.h +++ b/src/numpy_cpp.h @@ -481,7 +481,17 @@ class array_view : public detail::array_view_accessors size_t size() const { - return (size_t)dim(0); + bool empty = (ND == 0); + for (size_t i = 0; i < ND; i++) { + if (m_shape[i] == 0) { + empty = true; + } + } + if (empty) { + return 0; + } else { + return (size_t)dim(0); + } } bool empty() const pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy