The original random sampling method is pure python and when prior or posterior sampling is called a slow loop is running for sampling. Numba has similar syntax to numpy and therefore makes it easy to vectorize the sampling call. It can be implemented as a static broadcasted function that is called by this class
https://github.com/pymc-devs/pymc-experimental/blob/ae7b80fc8ad1636e8c5d178c46bd85cf3c0f2e85/pymc_experimental/distributions/discrete.py#L31
Make the random generator vectorized in numba.
The original random sampling method is pure python and when prior or posterior sampling is called a slow loop is running for sampling. Numba has similar syntax to numpy and therefore makes it easy to vectorize the sampling call. It can be implemented as a static broadcasted function that is called by this class