I was trying to combine several 1-d arrays into a 2-d array, and then expand it into a 3-d array of the specified shape, and I ran into this problem. The program works fine without the njit decorator.
This problem can be reproduced by the following code:
import numpy as np
import numba as nb
@nb.njit
def new_func():
a = np.arange(5)
b = a + 1
c = b + 1
arr = np.stack((a, b, c), axis=0)
print(arr)
tiled = np.full((3, 5, 10), arr[:, :, np.newaxis])
print(tiled.shape)
if __name__ == "__main__":
new_func()
It seems that Numba’s implementation of numpy.full doesn’t support using arrays as the fill_value argument. There’s an open feature request for this on the GitHub repository.