Generalized normal distribution

Generalized normal distribution only requires adding a shape parameter (power) to the normal distribution:
https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.gennorm.html

Can someone please tell me how I can implement this in pymc3? If I need to define my own distribution, how can I do it in Theano?