MCPcopy Index your code
hub / github.com/python/cpython / ndarray_from_structure

Function ndarray_from_structure

Lib/test/test_buffer.py:645–649  ·  view source on GitHub ↗

Return ndarray from the tuple returned by rand_structure()

(items, fmt, t, flags=0)

Source from the content-addressed store, hash-verified

643 return gen_items(memlen//itemsize, '#'+fmt, 'numpy')
644
645def ndarray_from_structure(items, fmt, t, flags=0):
646 """Return ndarray from the tuple returned by rand_structure()"""
647 memlen, itemsize, ndim, shape, strides, offset = t
648 return ndarray(items, shape=shape, strides=strides, format=fmt,
649 offset=offset, flags=ND_WRITABLE|flags)
650
651def numpy_array_from_structure(items, fmt, t):
652 """Return numpy_array from the tuple returned by rand_structure()"""

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…