Skip to content

Commit a7b3009

Browse files
committed
fix a test
1 parent fe3a8d5 commit a7b3009

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/varinfo.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,10 +488,17 @@ end
488488
end
489489
model = gdemo([1.0, 1.5], [2.0, 2.5])
490490

491-
# Check that instantiating the model does not perform linking
491+
# Check that instantiating the model using SampleFromUniform does not
492+
# perform linking
493+
# Note (penelopeysm): The purpose of using SampleFromUniform (SFU)
494+
# specifically in this test is because SFU samples from the linked
495+
# distribution i.e. in unconstrained space. However, it does this not
496+
# by linking the varinfo but by transforming the distributions on the
497+
# fly. That's why it's worth specifically checking that it can do this
498+
# without having to change the VarInfo object.
492499
vi = VarInfo()
493500
meta = vi.metadata
494-
model(vi)
501+
_, vi = DynamicPPL.sample!!(model, vi, SampleFromUniform())
495502
@test all(x -> !istrans(vi, x), meta.vns)
496503

497504
# Check that linking and invlinking set the `trans` flag accordingly

0 commit comments

Comments
 (0)