permute_dims
Permutes the axes (dimensions) of an array x.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
input array. |
required | |
axes
|
tuple containing a permutation of |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
array
|
an array containing the axes permutation. The returned array must have the same data type as |
Examples:
>>> a = sparse.COO.from_numpy(np.array([[0, 1], [2, 0]]))
>>> o = sparse.permute_dims(a, axes=(1, 0))
>>> o.todense()
array([[0, 2],
[1, 0]])
Source code in sparse/numba_backend/_common.py
2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 | |