MCPcopy
hub / github.com/numpy/numpy / _block_setup

Function _block_setup

numpy/_core/shape_base.py:954–966  ·  view source on GitHub ↗

Returns (`arrays`, list_ndim, result_ndim, final_size)

(arrays)

Source from the content-addressed store, hash-verified

952# or `_block_concatenate` without blocking large arrays to force the wisdom
953# to trigger the desired path.
954def _block_setup(arrays):
955 """
956 Returns
957 (`arrays`, list_ndim, result_ndim, final_size)
958 """
959 bottom_index, arr_ndim, final_size = _block_check_depths_match(arrays)
960 list_ndim = len(bottom_index)
961 if bottom_index and bottom_index[-1] is None:
962 raise ValueError(
963 f'List at {_block_format_index(bottom_index)} cannot be empty'
964 )
965 result_ndim = max(arr_ndim, list_ndim)
966 return arrays, list_ndim, result_ndim, final_size
967
968
969def _block_slicing(arrays, list_ndim, result_ndim):

Callers 4

_block_force_slicingMethod · 0.90
blockFunction · 0.85

Calls 3

_block_format_indexFunction · 0.85
maxFunction · 0.70

Tested by 3

_block_force_slicingMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…