Skip to content

Commit

Permalink
skip objective test if onnxmltools version is lower than 1.3
Browse files Browse the repository at this point in the history
Signed-off-by: Jan-Benedikt Jagusch <jan.jagusch@gmail.com>
  • Loading branch information
janjagusch committed Aug 12, 2021
1 parent dabc7fe commit 53712e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/lightgbm/test_objective_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import Dict, List, Tuple

import numpy as np
import onnxmltools
import pandas as pd
from onnx import ModelProto
from onnxconverter_common.data_types import DoubleTensorType, TensorType
Expand Down Expand Up @@ -64,7 +65,7 @@ def _assert_almost_equal(actual: np.array, desired: np.array, decimal: int=7, fr
success_rel = success_abs / len(actual)
assert success_rel >= frac, f"Only {success_abs} out of {len(actual)} rows are almost equal to {decimal} decimals."


@unittest.skipIf(tuple(int(ver) for ver in onnxmltools.__version__.split(".")) < (1, 3), "not supported in this library version")
def test_objective(self):
"""
Test if a LGBMRegressor a with certain objective (e.g. 'poisson') can be converted to ONNX
Expand Down

0 comments on commit 53712e6

Please sign in to comment.