Skip to content

Commit 6e1e44b

Browse files
committed
add test for new signature
1 parent 92f8b40 commit 6e1e44b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/graph/test_replace.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,17 @@ def test_graph_replace(self):
169169
# the old reference is still kept
170170
assert oc.owner.inputs[0].owner.inputs[1] is w
171171

172+
def test_non_list_input(self):
173+
x = MyVariable("x")
174+
y = MyVariable("y")
175+
o = MyOp("xyop")(x, y)
176+
new_x = x.clone(name="x_new")
177+
new_y = y.clone(name="y2_new")
178+
# test non list inputs as well
179+
oc = graph_replace(o, {x: new_x, y: new_y})
180+
assert oc.owner.inputs[1] is new_y
181+
assert oc.owner.inputs[0] is new_x
182+
172183
def test_graph_replace_advanced(self):
173184
x = MyVariable("x")
174185
y = MyVariable("y")

0 commit comments

Comments
 (0)