masahi commented on code in PR #10898:
URL: https://github.com/apache/tvm/pull/10898#discussion_r843255457


##########
tests/python/frontend/onnx/test_forward.py:
##########
@@ -5375,6 +5375,67 @@ def verify_reverse_sequence(x, sequence_lens, 
batch_axis, time_axis):
     verify_reverse_sequence(x, sequence_lens, 1, 0)
 
 
[email protected]_targets
+def test_gelu(target, dev):
+    def verify_gelu(x):
+        node = onnx.helper.make_node(
+            "Gelu",
+            inputs=["x"],
+            outputs=["y"],
+            domain="com.microsoft",
+        )
+
+        graph = helper.make_graph(
+            [node],
+            "gelu_test",
+            inputs=[helper.make_tensor_value_info("x", TensorProto.FLOAT, 
list(x.shape))],
+            outputs=[helper.make_tensor_value_info("y", TensorProto.FLOAT, 
list(x.shape))],
+        )
+
+        model = helper.make_model(graph, producer_name="gelu_test")
+        verify_with_ort_with_inputs(model, [x], [x.shape], target=target, 
dev=dev)
+
+    x = np.array([-1.0, 0, 1.0, 100.0, -100.0, 1000.0, -1000.0], 
dtype=np.float32)
+    verify_gelu(x)
+    x = np.array([[1, 2], [3, 4]], dtype=np.float32)
+    verify_gelu(x)
+
+
[email protected]_targets
+def test_biasgelu(target, dev):
+    if target != "llvm":
+        pass

Review Comment:
   Why skip other tests?



##########
tests/python/frontend/onnx/test_forward.py:
##########
@@ -5375,6 +5375,67 @@ def verify_reverse_sequence(x, sequence_lens, 
batch_axis, time_axis):
     verify_reverse_sequence(x, sequence_lens, 1, 0)
 
 
[email protected]_targets
+def test_gelu(target, dev):
+    def verify_gelu(x):
+        node = onnx.helper.make_node(
+            "Gelu",
+            inputs=["x"],
+            outputs=["y"],
+            domain="com.microsoft",
+        )
+
+        graph = helper.make_graph(
+            [node],
+            "gelu_test",
+            inputs=[helper.make_tensor_value_info("x", TensorProto.FLOAT, 
list(x.shape))],
+            outputs=[helper.make_tensor_value_info("y", TensorProto.FLOAT, 
list(x.shape))],
+        )
+
+        model = helper.make_model(graph, producer_name="gelu_test")
+        verify_with_ort_with_inputs(model, [x], [x.shape], target=target, 
dev=dev)
+
+    x = np.array([-1.0, 0, 1.0, 100.0, -100.0, 1000.0, -1000.0], 
dtype=np.float32)
+    verify_gelu(x)
+    x = np.array([[1, 2], [3, 4]], dtype=np.float32)
+    verify_gelu(x)
+
+
[email protected]_targets
+def test_biasgelu(target, dev):
+    if target != "llvm":
+        pass

Review Comment:
   Why skip other targets?



-- 
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]

Reply via email to