You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "Hzfengsy (via GitHub)" <gi...@apache.org> on 2023/11/01 03:03:38 UTC
Re: [PR] [Pylint] fix pylint issues for thrust&tflite_runtime&util [tvm]
Hzfengsy commented on code in PR #16023:
URL: https://github.com/apache/tvm/pull/16023#discussion_r1378347032
##########
tests/python/contrib/test_tflite_runtime.py:
##########
@@ -14,47 +14,49 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
+"""Configure pytest"""
+import importlib
import pytest
-
-import tvm
-from tvm import te
import numpy as np
+import tvm
from tvm import rpc
from tvm.contrib import utils, tflite_runtime
def _create_tflite_model():
+ """Functions of creating a tflite model"""
if not tvm.runtime.enabled("tflite"):
print("skip because tflite runtime is not enabled...")
- return
+ return None
if not tvm.get_global_func("tvm.tflite_runtime.create", True):
print("skip because tflite runtime is not enabled...")
- return
+ return None
try:
- import tensorflow as tf
+ tf_lib = importlib.import_module("tensorflow")
Review Comment:
It's better to use `# pylint: disable=import-outside-toplevel` in this file, rather than importlib
--
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