Skip to content

Commit

Permalink
prevent sample shape for monte carlo methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinvtran committed Mar 27, 2017
1 parent 2c53d8a commit 398e0a5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions edward/inferences/monte_carlo.py
Expand Up @@ -82,6 +82,9 @@ def __init__(self, latent_vars=None, data=None):
if not isinstance(qz, Empirical):
raise TypeError("Posterior approximation must consist of only "
"Empirical random variables.")
elif len(qz.get_sample_shape()) != 0:
raise ValueError("Empirical posterior approximations must have "
"a scalar sample shape.")

super(MonteCarlo, self).__init__(latent_vars, data)

Expand Down

0 comments on commit 398e0a5

Please sign in to comment.