agoston-mc commented on code in PR #17053:
URL: https://github.com/apache/tvm/pull/17053#discussion_r1629836129


##########
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:
   Should I also add structural tests for Relay, or would you prefer Relax 
only? In that case execution tests would exist for both frontends under 
tvm-root/tests/python/nightly/frontend/, and the structural Relax tests would 
be kept in the normal folder, tvm-root/tests/python/relax/. 
   If structural Relay tests are preferable, what IRModule creating method is 
recommended for Relay creation? Building a relay.Function, and comparing that 
with the frontend's module? Can I follow this example, and compare a span 
filled, with a non-span filled graph? 
https://github.com/apache/tvm/blob/main/tests/python/frontend/pytorch/test_fx_quant.py#L42
   
   Also, how should I create the directory structure under nightly/frontend? 
Should I separate Relay from Relax under a similar structure to regular tests? 
Or do you have a system in mind?
   
   
   
   
    



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