MCPcopy Index your code
hub / github.com/numpy/numpy / _create_arrays

Function _create_arrays

numpy/lib/_function_base_impl.py:2256–2269  ·  view source on GitHub ↗

Helper for creating output arrays in vectorize.

(broadcast_shape, dim_sizes, list_of_core_dims, dtypes,
                   results=None)

Source from the content-addressed store, hash-verified

2254
2255
2256def _create_arrays(broadcast_shape, dim_sizes, list_of_core_dims, dtypes,
2257 results=None):
2258 """Helper for creating output arrays in vectorize."""
2259 shapes = _calculate_shapes(broadcast_shape, dim_sizes, list_of_core_dims)
2260 if dtypes is None:
2261 dtypes = [None] * len(shapes)
2262 if results is None:
2263 arrays = tuple(np.empty(shape=shape, dtype=dtype)
2264 for shape, dtype in zip(shapes, dtypes))
2265 else:
2266 arrays = tuple(np.empty_like(result, shape=shape, dtype=dtype)
2267 for result, shape, dtype
2268 in zip(results, shapes, dtypes))
2269 return arrays
2270
2271
2272def _get_vectorize_dtype(dtype):

Callers 1

Calls 1

_calculate_shapesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…