\rst Creates memoryview
from static buffer.
This method is meant for providing a memoryview
for C/C++ buffer not managed by Python. The caller is responsible for managing the lifetime of ptr
and format
, which MUST outlive the memoryview constructed here.
See also: Python C API documentation for PyMemoryView_FromBuffer
_.
.. _PyMemoryView_FromBuffer: https://docs.python.org/c-api/memoryview.html#c.PyMemoryView_FromBuffer
:param ptr: Pointer to the buffer. :param itemsize: Byte size of an element. :param format: Pointer to the null-terminated format string. For homogeneous Buffers, this should be set to format_descriptor<T>::value
. :param shape: Shape of the tensor (1 entry per dimension). :param strides: Number of bytes between adjacent entries (for each per dimension). :param readonly: Flag to indicate if the underlying storage may be written to. \endrst
Definition at line 1526 of file pytypes.h.