File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -485,3 +485,18 @@ def test_size_from_dims_rng_update(self):
485
485
# Confirm that the rng is properly offset, otherwise the second value of the first
486
486
# draw, would match the first value of the second draw
487
487
assert fn ()[1 ] != fn ()[0 ]
488
+
489
+ def test_size_from_observed_rng_update (self ):
490
+ """Test that when setting size from observed we update the rng properly
491
+ See https://github.com/pymc-devs/pymc/issues/5653
492
+ """
493
+ with pm .Model ():
494
+ x = pm .Normal ("x" , observed = [0 , 1 ])
495
+
496
+ fn = pm .aesaraf .compile_pymc ([], x )
497
+ # Check that both function outputs (rng and draws) come from the same Apply node
498
+ assert fn .maker .fgraph .outputs [0 ].owner is fn .maker .fgraph .outputs [1 ].owner
499
+
500
+ # Confirm that the rng is properly offset, otherwise the second value of the first
501
+ # draw, would match the first value of the second draw
502
+ assert fn ()[1 ] != fn ()[0 ]
You can’t perform that action at this time.
0 commit comments