Как воссоздать ось = 2 в np.repeat() для Numba ⇐ Python
Как воссоздать ось = 2 в np.repeat() для Numba
I'm trying to convert my code to Numba friendly implementation, however I keep running into errors with the axis argument (as it is not supported). Specifically, I need to use the np.repeat() function in axis=2
In numpy my code is:
original = np.random.rand(1000,1) no_repeats = 10 big_original = np.repeat(np.expand_dims((5)*original, axis=2), no_repeats, axis=2) How could I rewrite this in a Numba friendly way?
I have tried to use np.dstack:
expanded_original = np.expand_dims((5)*original, axis=2) big_original = np.dstack([expanded_original]*no_repeats) But of course lists aren't a supported datatype. How could I go about this in the most efficient way?
Источник: https://stackoverflow.com/questions/781 ... -for-numba
I'm trying to convert my code to Numba friendly implementation, however I keep running into errors with the axis argument (as it is not supported). Specifically, I need to use the np.repeat() function in axis=2
In numpy my code is:
original = np.random.rand(1000,1) no_repeats = 10 big_original = np.repeat(np.expand_dims((5)*original, axis=2), no_repeats, axis=2) How could I rewrite this in a Numba friendly way?
I have tried to use np.dstack:
expanded_original = np.expand_dims((5)*original, axis=2) big_original = np.dstack([expanded_original]*no_repeats) But of course lists aren't a supported datatype. How could I go about this in the most efficient way?
Источник: https://stackoverflow.com/questions/781 ... -for-numba
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Выражение CSS `repeat: round;` выглядит так же, как и `facker-repeat: повторить;` на iPhone
Anonymous » » в форуме CSS - 0 Ответы
- 3 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Как я могу из Jitted-функции Numba вызвать другую Jit-функцию Numba с указателем?
Anonymous » » в форуме Python - 0 Ответы
- 36 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Как я могу из Jitted-функции Numba вызвать другую Jit-функцию Numba с указателем?
Anonymous » » в форуме Python - 0 Ответы
- 39 Просмотры
-
Последнее сообщение Anonymous
-