Skip to content

Commit

Permalink
Take out size=1 special case from MixtureSameFamily
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelosthege committed Dec 20, 2020
1 parent 25f6108 commit 3e52058
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions pymc3/distributions/mixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,12 +870,6 @@ def random(self, point=None, size=None):

# The `samples` array still has the `mixture_axis`, so we must remove it:
output = samples[(..., 0) + (slice(None),) * len(event_shape)]

# Final oddity: if size == 1, pymc3 defaults to reducing the sample_shape dimension
# We do this to stay consistent with the rest of the package even though
# we shouldn't have to do it.
if size == 1:
output = output[0]
return output

def _distr_parameters_for_repr(self):
Expand Down

0 comments on commit 3e52058

Please sign in to comment.