Cannot find core `_helperlib` methods in custom overloaded methods

The following:

@overload_method(RandomStateNumbaType, "normal")
def numba_normal_dist(rng, a, b):
    def normal(rng, a, b):
        ptr = numba._helperlib.rnd_get_np_state_ptr()
        numba._helperlib.rnd_set_state(ptr, (rng.pos, rng.state_key))
        return np.random.normal(a,b)
    return normal

Fails with error,

TypingError: Failed in nopython mode pipeline (step: nopython frontend)
    Unknown attribute 'rnd_get_np_state_ptr' of type Module(<module 'numba._helperlib' from '/home/kc611/anaconda3/envs/aesara/lib/python3.8/site-packages/numba/'>)

Why are these methods inaccessible from the lowered interface ?

The full code is at:

1 Like