Imported from https://github.com/mukehvier/tensorflow-prob