Skip to content

Commit 263fdff

Browse files
committed
add test from issue #145
1 parent 2226ecc commit 263fdff

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/test_adapt.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def test_inline_model_custom_node_nested(old_squeeze: onnx.ModelProto):
238238
build({"a": a}, {"c": c})
239239

240240

241-
def test_if_adaptation_const():
241+
def test_if_adapatation_squeeze():
242242
cond = argument(Tensor(numpy.bool_, ()))
243243
b = argument(Tensor(numpy.float32, (1,)))
244244
squeezed = Squeeze11.squeeze11(b, [0])
@@ -255,3 +255,11 @@ def test_if_adaptation_const():
255255
out = ort.InferenceSession(model.SerializeToString()).run(
256256
None, {"b": b, "cond": cond}
257257
)
258+
259+
260+
def test_if_adaptation_const():
261+
sq = op19.const(1.1453, dtype=numpy.float32)
262+
b = argument(Tensor(numpy.float32, ("N",)))
263+
cond = op18.equal(sq, b)
264+
out = op18.if_(cond, then_branch=lambda: [sq], else_branch=lambda: [sq])
265+
build({"b": b}, {"out": out[0]})

0 commit comments

Comments
 (0)