Skip to content

Commit

Permalink
fix converters for old versions of xgboost
Browse files Browse the repository at this point in the history
Signed-off-by: Xavier Dupre <[email protected]>
  • Loading branch information
xadupre committed Dec 15, 2023
1 parent 21bb426 commit 6edd641
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions onnxmltools/convert/xgboost/shape_calculators/Classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6edd641

Please sign in to comment.