Skip to content

Commit 86a247e

Browse files
authored
Use isinstance for type comparison (#431)
1 parent 23e20f5 commit 86a247e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/setfit/exporters/onnx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def export_sklearn_head_to_onnx(model_head: LogisticRegression, opset: int) -> o
153153

154154
# If the datatype of the model is double we need to cast the outputs
155155
# from the setfit model to doubles for compatibility inside of ONNX.
156-
if type(dtype) == onnxconverter_common.data_types.DoubleTensorType:
156+
if isinstance(dtype, onnxconverter_common.data_types.DoubleTensorType):
157157
sklearn_model = Pipeline([("castdouble", CastTransformer(dtype=np.double)), ("head", model_head)])
158158
else:
159159
sklearn_model = model_head

0 commit comments

Comments
 (0)