Skip to content

Commit e3c84a2

Browse files
authored
Merge pull request #97 from ins-amu/test-sdde-pytree-gfun-13675562618858242055
Add test for gfun generating Pytree in test_heun_pytree
2 parents 3f6af15 + ba86ed8 commit e3c84a2

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

vbjax/tests/test_loops.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,13 @@ def f(xs: State, x: State, t, p):
213213
_, xs = loop(xs, None)
214214
assert xs.x.shape == z.x[:-(nh+1)].shape
215215

216-
# TODO test also w/ gfun generating pytree
216+
def g(x, p):
217+
return State(x=0.01, y=0.02)
218+
_, loop = vb.make_sdde(dt, nh, f, g)
219+
buf = State(x=vb.randn(100, 32), y=vb.randn(100, 32))
220+
_, xs = loop(buf, None)
221+
assert xs.x.shape == buf.x[:-(nh+1)].shape
222+
assert xs.y.shape == buf.y[:-(nh+1)].shape
217223

218224

219225
def test_continuation():

0 commit comments

Comments
 (0)