Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

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:
    46
    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>'