From 6edd641a48a27ac7f7fc6210ee23834adb6b4f78 Mon Sep 17 00:00:00 2001 From: Xavier Dupre Date: Fri, 15 Dec 2023 19:52:55 +0100 Subject: [PATCH] fix converters for old versions of xgboost Signed-off-by: Xavier Dupre --- onnxmltools/convert/xgboost/shape_calculators/Classifier.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/onnxmltools/convert/xgboost/shape_calculators/Classifier.py b/onnxmltools/convert/xgboost/shape_calculators/Classifier.py index c38bcdac..e44d5a52 100644 --- a/onnxmltools/convert/xgboost/shape_calculators/Classifier.py +++ b/onnxmltools/convert/xgboost/shape_calculators/Classifier.py @@ -38,8 +38,10 @@ def calculate_xgboost_classifier_output_shapes(operator): if objective == "reg:logistic" and ncl == 1: ncl = 2 classes = xgb_node.classes_ - if np.issubdtype(classes.dtype, np.floating) or np.issubdtype( - classes.dtype, np.integer + if ( + np.issubdtype(classes.dtype, np.floating) + or np.issubdtype(classes.dtype, np.integer) + or np.issubdtype(classes.dtype, np.bool_) ): operator.outputs[0].type = Int64TensorType(shape=[N]) else: