Skip to content

Commit 3095071

Browse files
take out old (1,) shape handling
1 parent 21de446 commit 3095071

File tree

2 files changed

+0
-5
lines changed

2 files changed

+0
-5
lines changed

pymc3/distributions/posterior_predictive.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,6 @@ def random_sample(
558558
shape: Tuple[int, ...],
559559
) -> np.ndarray:
560560
val = meth(point=point, size=size)
561-
if size == 1:
562-
val = np.expand_dims(val, axis=0)
563561
try:
564562
assert val.shape == (size,) + shape, (
565563
"Sampling from random of %s yields wrong shape" % param

pymc3/tests/test_shape_handling.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,6 @@ def test_broadcast_dist_samples_to(self, samples_to_broadcast_to):
211211
def test_sample_generate_values(fixture_model, fixture_sizes):
212212
model, RVs = fixture_model
213213
size = to_tuple(fixture_sizes)
214-
if size == (1,):
215-
# Single draws are interpreted as scalars for backwards compatibility
216-
size = tuple()
217214
with model:
218215
prior = pm.sample_prior_predictive(samples=fixture_sizes)
219216
for rv in RVs:

0 commit comments

Comments
 (0)