Skip to content

Commit

Permalink
fix old CI
Browse files Browse the repository at this point in the history
Signed-off-by: Xavier Dupre <[email protected]>
  • Loading branch information
xadupre committed Aug 1, 2023
1 parent 8247576 commit 69ea0b9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion docs/examples/plot_cast_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"""
import onnxruntime
import onnx
import numpy
import os
import math
import numpy as np
Expand Down
1 change: 0 additions & 1 deletion docs/examples/plot_tfidfvectorizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import matplotlib.pyplot as plt
import os
from onnx.tools.net_drawer import GetPydotGraph, GetOpNodeProducer
import numpy
import onnxruntime as rt
from skl2onnx.common.data_types import StringTensorType
from skl2onnx import convert_sklearn
Expand Down
12 changes: 10 additions & 2 deletions tests/test_sklearn_classifiers_extreme.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

import unittest
import numpy as np
from onnx.reference import ReferenceEvaluator

try:
from onnx.reference import ReferenceEvaluator
except ImportError:
ReferenceEvaluator = None
from sklearn.tree import DecisionTreeClassifier
from onnxruntime import InferenceSession
from skl2onnx import to_onnx
Expand All @@ -21,11 +25,15 @@ def test_one_training_class(self):
onx = to_onnx(cl, x, target_opset=TARGET_OPSET, options={"zipmap": False})

for cls in [
lambda onx: ReferenceEvaluator(onx, verbose=0),
(lambda onx: ReferenceEvaluator(onx, verbose=0))
if ReferenceEvaluator is not None
else None,
lambda onx: InferenceSession(
onx.SerializeToString(), providers=["CPUExecutionProvider"]
),
]:
if cls is None:
continue
sess = cls(onx)
res = sess.run(None, {"X": x})
self.assertEqual(len(res), len(expected))
Expand Down

0 comments on commit 69ea0b9

Please sign in to comment.