by Anonymous » 02 Apr 2025, 12:17
Ich habe ein 2-D-Array und es erfordert ein Cumsum-Reihen. Aber Axis wird in Numba nicht unterstützt. Also stecke ich fest. Jede Hilfe wird geschätzt. < /P>
Code: Select all
from numba import jit
import numpy as np
@nb.njit(['(float32[:,:],)', '(float64[:,:],)'])
def error():
weights = np.ones((100, 100))
np.cumsum(weights, axis = 1)
error()
>>> cumsum(array(float64, 2d, C), axis=Literal[int](1))
Ich habe ein 2-D-Array und es erfordert ein Cumsum-Reihen. Aber Axis wird in Numba nicht unterstützt. Also stecke ich fest. Jede Hilfe wird geschätzt. < /P>
[code]from numba import jit
import numpy as np
@nb.njit(['(float32[:,:],)', '(float64[:,:],)'])
def error():
weights = np.ones((100, 100))
np.cumsum(weights, axis = 1)
error()
>>> cumsum(array(float64, 2d, C), axis=Literal[int](1))
[/code]