tqchen commented on code in PR #17053:
URL: https://github.com/apache/tvm/pull/17053#discussion_r1629955811


##########
tests/python/frontend/nnef/test_forward.py:
##########
@@ -0,0 +1,1627 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import os
+
+import numpy as np
+
+import _nnef
+import nnef
+import nnef_tools.interpreter.pytorch as interpreter
+
+import tvm
+import tvm.testing
+from tvm import relay
+
+
+graphs_dir = os.path.join("tests", "python", "frontend", "nnef", "cases")
+
+
+def get_nnef_outputs(path, inputs):
+    ip = interpreter.Interpreter(path, None, None)
+    inputs = [inputs[tensor.name] for tensor in ip.input_details()]
+    return ip(inputs)
+
+
+def get_type(val):
+    if val == "scalar":
+        return "float32"
+    if val == "integer":
+        return "int32"
+    if val == "logical":
+        return "bool"
+    if val == "string":
+        return "string"
+
+
+def verify_model(
+    model_path,

Review Comment:
   if we want to keep execution tests in relay, please put them under 
nightly/frontend. Since relay creation can be harder
   
   For relax, we can do structure test



-- 
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: commits-unsubscr...@tvm.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to