ophirfrish commented on a change in pull request #9074:
URL: https://github.com/apache/tvm/pull/9074#discussion_r756616855



##########
File path: python/tvm/driver/tvmc/frontends.py
##########
@@ -76,20 +78,19 @@ def load(self, path, shape_dict=None, **kwargs):
         """
 
 
-def import_keras():
-    """Lazy import function for Keras"""
-    # Keras writes the message "Using TensorFlow backend." to stderr
-    # Redirect stderr during the import to disable this
-    stderr = sys.stderr
-    sys.stderr = open(os.devnull, "w")
+def lazy_import(pkg_name, from_pkg_name=None, hide_stderr=False):
+    """Lazy import a frontend package or subpackage"""
     try:
-        # pylint: disable=C0415
-        import tensorflow as tf
-        from tensorflow import keras
+        if hide_stderr:
+            stderr = sys.stderr
+            sys.stderr = open(os.devnull, "w")

Review comment:
       Yes I agree that this one should be removed




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