Skip to content

Commit bc3dda0

Browse files
committed
Cleanup OFG tests
1 parent ca7e8b8 commit bc3dda0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/compile/test_builders.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,12 +555,15 @@ def test_outputs_consistency(self):
555555

556556
def test_explicit_input_from_constant(self):
557557
x = pt.dscalar("x")
558-
y = constant(1.0, name="y")
558+
y = constant(1.0, dtype=x.type.dtype, name="y")
559559
test_ofg = OpFromGraph([x, y], [x + y])
560560

561561
out = test_ofg(x, y)
562562
assert out.eval({x: 5}) == 6
563563

564+
out = test_ofg(x, x)
565+
assert out.eval({x: 5}) == 10
566+
564567
def test_explicit_input_from_shared(self):
565568
x = pt.dscalar("x")
566569
y = shared(1.0, name="y")
@@ -576,7 +579,10 @@ def test_explicit_input_from_shared(self):
576579
out = test_ofg(x, y)
577580
assert out.eval({x: 5}) == 6
578581
y.set_value(2.0)
579-
assert out.eval({x: 6})
582+
assert out.eval({x: 6}) == 8
583+
584+
out = test_ofg(y, y)
585+
assert out.eval() == 4
580586

581587

582588
@config.change_flags(floatX="float64")

0 commit comments

Comments
 (0)