Return the total number of elements of x. Parameters ---------- x : array Array instance from NumPy or an array API compatible library. Returns ------- out : int Total number of elements.
(x)
| 249 | |
| 250 | |
| 251 | def size(x): |
| 252 | """Return the total number of elements of x. |
| 253 | |
| 254 | Parameters |
| 255 | ---------- |
| 256 | x : array |
| 257 | Array instance from NumPy or an array API compatible library. |
| 258 | |
| 259 | Returns |
| 260 | ------- |
| 261 | out : int |
| 262 | Total number of elements. |
| 263 | """ |
| 264 | return math.prod(x.shape) |
| 265 | |
| 266 | |
| 267 | def _is_numpy_namespace(xp): |
no outgoing calls
no test coverage detected
searching dependent graphs…