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
2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 |
|