Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Bug numba.njit failed with cache=True

Discussion in 'Formats & External Tools Previews' started by guoxx_, Dec 22, 2022.

  1. guoxx_

    guoxx_

    Joined:
    Mar 16, 2021
    Posts:
    55
    The following python code failed to JIT when cache was enabled.

    @njit(nogil=True, cache=True)
    def spherical_dir(theta, phi):
    x = np.sin(theta) * np.cos(phi)
    y = np.sin(theta) * np.sin(phi)
    z = np.cos(theta)
    return x, y, z


    error message:
    PythonException: cannot cache function 'spherical_dir': no locator available for file '<string>'