MCPcopy
hub / github.com/dask/dask / expand_dims

Function expand_dims

dask/array/routines.py:1977–1987  ·  view source on GitHub ↗
(a, axis)

Source from the content-addressed store, hash-verified

1975
1976@derived_from(np)
1977def expand_dims(a, axis):
1978 if type(axis) not in (tuple, list):
1979 axis = (axis,)
1980
1981 out_ndim = len(axis) + a.ndim
1982 axis = validate_axis(axis, out_ndim)
1983
1984 shape_it = iter(a.shape)
1985 shape = [1 if ax in axis else next(shape_it) for ax in range(out_ndim)]
1986
1987 return a.reshape(shape)
1988
1989
1990@derived_from(np)

Callers

nothing calls this directly

Calls 2

validate_axisFunction · 0.90
reshapeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…