Skip to content

Commit a886abc

Browse files
authored
Pass size to HalfNormal random method (#3686)
* Pass size to HalfNormal random method * Add note in release notes
1 parent 5e9f349 commit a886abc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

RELEASE-NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
- Fixed a defect in `OrderedLogistic.__init__` that unnecessarily increased the dimensionality of the underlying `p`. Related to issue issue [#3535](https://github.com/pymc-devs/pymc3/issues/3535) but was not the true cause of it.
3232
- Wrapped `DensityDist.rand` with `generate_samples` to make it aware of the distribution's shape. Added control flow attributes to still be able to behave as in earlier versions, and to control how to interpret the `size` parameter in the `random` callable signature. Fixes [3553](https://github.com/pymc-devs/pymc3/issues/3553)
3333
- Added `theano.gof.graph.Constant` to type checks done in `_draw_value` (fixes issue [3595](https://github.com/pymc-devs/pymc3/issues/3595))
34-
34+
- `HalfNormal` did not used to work properly in `draw_values`, `sample_prior_predictive`, or `sample_posterior_predictive` (fixes issue [3686](https://github.com/pymc-devs/pymc3/pull/3686))
3535

3636
## PyMC3 3.7 (May 29 2019)
3737

pymc3/distributions/continuous.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ def random(self, point=None, size=None):
855855
-------
856856
array
857857
"""
858-
sigma = draw_values([self.sigma], point=point)[0]
858+
sigma = draw_values([self.sigma], point=point, size=size)[0]
859859
return generate_samples(stats.halfnorm.rvs, loc=0., scale=sigma,
860860
dist_shape=self.shape,
861861
size=size)

0 commit comments

Comments
 (0)