| 894 | |
| 895 | |
| 896 | def _block_slicing(arrays, list_ndim, result_ndim): |
| 897 | shape, slices, arrays = _block_info_recursion( |
| 898 | arrays, list_ndim, result_ndim) |
| 899 | dtype = _nx.result_type(*[arr.dtype for arr in arrays]) |
| 900 | |
| 901 | # Test preferring F only in the case that all input arrays are F |
| 902 | F_order = all(arr.flags['F_CONTIGUOUS'] for arr in arrays) |
| 903 | C_order = all(arr.flags['C_CONTIGUOUS'] for arr in arrays) |
| 904 | order = 'F' if F_order and not C_order else 'C' |
| 905 | result = _nx.empty(shape=shape, dtype=dtype, order=order) |
| 906 | # Note: In a c implementation, the function |
| 907 | # PyArray_CreateMultiSortedStridePerm could be used for more advanced |
| 908 | # guessing of the desired order. |
| 909 | |
| 910 | for the_slice, arr in zip(slices, arrays): |
| 911 | result[(Ellipsis,) + the_slice] = arr |
| 912 | return result |
| 913 | |
| 914 | |
| 915 | def _block_concatenate(arrays, list_ndim, result_ndim): |