Skip to content

Commit 49bbf8c

Browse files
committed
also test if trace has same len but dim set to diff len
1 parent d40fffe commit 49bbf8c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/sampling/test_forward.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,15 @@ def test_length_coords_volatile(self):
458458
).posterior_predictive
459459
assert pp_diff_len["y"] != np.pi
460460

461+
# Changing the dim length on the model itself
462+
# -- `x` is volatile even though trace has same len
463+
model.set_dim("trial", new_length=7)
464+
with model:
465+
pp_diff_len_model_set = pm.sample_posterior_predictive(
466+
trace_same_len, var_names=["y"]
467+
).posterior_predictive
468+
assert pp_diff_len_model_set["y"] != np.pi
469+
461470

462471
class TestSamplePPC:
463472
def test_normal_scalar(self):

0 commit comments

Comments
 (0)