numpy.setbufsize(size)
Set the size of the buffer used in ufuncs.
Changed in version 2.0: The scope of setting the buffer is tied to the
context. Exiting a witherrstate(): will also restore the bufsize.
Parameters:sizeintSize of buffer.
Returns:bufsizeintPrevious size of ufunc buffer in bytes.
Notes
Concurrency note: see
Examples
When exiting a
context manager the bufsize is restored:
>>> importnumpyasnp>>> withnp.errstate():... np.setbufsize(4096)... print(np.getbufsize())...81924096>>> np.getbufsize()8192