You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/09/14 14:53:42 UTC

[GitHub] [tvm] Lunderberg commented on a change in pull request #8806: [3/6] Arm(R) Ethos(TM)-U NPU TIR compiler with conv2d support

Lunderberg commented on a change in pull request #8806:
URL: https://github.com/apache/tvm/pull/8806#discussion_r708354362



##########
File path: tests/python/contrib/test_ethosu/test_extract_constants.py
##########
@@ -0,0 +1,99 @@
+# 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 pytest
+
+pytest.importorskip("ethosu.vela")

Review comment:
       Yup, this works, and allows the test suite to run regardless of the platform.  The main issue I've seen with `pytest.importorskip` is that the tests in the file are entirely removed from the test report, rather than showing up as explicitly being skipped.
   
   To have the tests show up in the test report, an individual test can be marked with `tvm.testing.requires_package('ethosu.vela')`, and the `from tvm.relay.backend.contrib.ethosu import util` statement moved into the body of the test function.  However, this isn't the cleanest solution and I have some ideas on how to improve the ergonomics of skipping tests this way, so `pytest.importorskip` is a good use in the meantime.




-- 
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-unsubscribe@tvm.apache.org

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