ConvolutedDog commented on code in PR #19535:
URL: https://github.com/apache/tvm/pull/19535#discussion_r3218828592


##########
tests/python/relax/test_frontend_onnx.py:
##########
@@ -1435,6 +1453,50 @@ def test_clip_v6(max, min):
     check_correctness(model, opset=10)
 
 
[email protected](
+    "min,max",
+    [
+        pytest.param(
+            np.array(0.0, dtype=np.float32),
+            np.array(np.nan, dtype=np.float32),
+        ),
+        pytest.param(
+            np.array(0.0, dtype=np.float32),
+            np.array(np.nan, dtype=np.float32),
+        ),

Review Comment:
   Addressed in 
https://github.com/apache/tvm/pull/19535/changes/c6c1e49defca1aa6dd348c57595e1bf8926aa301



##########
tests/python/relax/test_frontend_onnx.py:
##########
@@ -1435,6 +1453,50 @@ def test_clip_v6(max, min):
     check_correctness(model, opset=10)
 
 
[email protected](
+    "min,max",
+    [
+        pytest.param(
+            np.array(0.0, dtype=np.float32),
+            np.array(np.nan, dtype=np.float32),
+        ),
+        pytest.param(
+            np.array(0.0, dtype=np.float32),
+            np.array(np.nan, dtype=np.float32),
+        ),
+        pytest.param(
+            np.array(np.nan, dtype=np.float32),
+            np.array(6.0, dtype=np.float32),
+        ),
+        pytest.param(
+            np.array(np.nan, dtype=np.float32),
+            np.array(np.nan, dtype=np.float32),
+        ),
+    ],
+)
+def test_clip_v13(min, max):
+    # Opset 13: tensor min/max. NaN bound => unbounded on that side (ORT); 
input NaN preserved.
+    clip_node = helper.make_node("Clip", ["input", "min", "max"], ["output"])
+    graph = helper.make_graph(
+        [clip_node],
+        "clip_v13_nan_max",
+        inputs=[
+            helper.make_tensor_value_info("input", TensorProto.FLOAT, [5]),
+            helper.make_tensor_value_info("min", TensorProto.FLOAT, []),
+            helper.make_tensor_value_info("max", TensorProto.FLOAT, []),
+        ],
+        outputs=[helper.make_tensor_value_info("output", TensorProto.FLOAT, 
[5])],
+    )
+    model = helper.make_model(graph, producer_name="clip_v13_nan_max")
+    input = np.array([0.5, -3.0, 4.5, 11.0, 7.0], dtype=np.float32)
+    check_correctness(
+        model,
+        inputs={"input": input, "min": min, "max": max},
+        opset=13,
+        equal_nan=True,
+    )

Review Comment:
   Addressed in 
https://github.com/apache/tvm/pull/19535/changes/c6c1e49defca1aa6dd348c57595e1bf8926aa301



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to