From 991b6fbdb101fbdeeb27d935061296670510586f Mon Sep 17 00:00:00 2001 From: Jan Sterba Date: Mon, 9 Dec 2019 14:44:14 +0100 Subject: [PATCH] Add support for detecting if h2o is installed. --- onnxconverter_common/utils.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/onnxconverter_common/utils.py b/onnxconverter_common/utils.py index 8da1ce9..62f6d7b 100644 --- a/onnxconverter_common/utils.py +++ b/onnxconverter_common/utils.py @@ -140,6 +140,15 @@ def xgboost_installed(): warnings.warn('The converter works for xgboost >= 0.7. Earlier versions might not.') return True +def h2o_installed(): + """ + Checks that *h2o* is available. + """ + try: + import h2o + except ImportError: + return False + return True def get_producer(): """