MCPcopy Create free account
hub / github.com/DedalusProject/dedalus / move_single_axis

Function move_single_axis

dedalus/tools/array.py:97–101  ·  view source on GitHub ↗

Similar to np.moveaxis but faster for just a single axis.

(a, source, destination)

Source from the content-addressed store, hash-verified

95
96
97def move_single_axis(a, source, destination):
98 """Similar to np.moveaxis but faster for just a single axis."""
99 order = [n for n in range(a.ndim) if n != source]
100 order.insert(destination, source)
101 return a.transpose(order)
102
103
104def apply_dense(matrix, array, axis, out=None):

Callers 2

apply_denseFunction · 0.85
apply_sparse_dotFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected