The partition function of the Bures ensemble as the τ-function of BKP and DKP hierarchies: continuous and discrete