Skip to content

Commit

Permalink
[fix] Make finite assert logging more informative in daal4py (#2166)
Browse files Browse the repository at this point in the history
* Update validation.py

* formatting
  • Loading branch information
icfaust authored Nov 19, 2024
1 parent 127233b commit 2c96011
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions daal4py/sklearn/utils/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,12 @@ def _assert_all_finite(
)
_dal_ready = _patching_status.and_conditions(
[
(X.ndim in [1, 2], "X has not 1 or 2 dimensions."),
(not np.any(np.equal(X.shape, 0)), "X shape contains 0."),
(dt in [np.float32, np.float64], "X dtype is not float32 or float64."),
(X.ndim in [1, 2], f"Input {input_name} does not have 1 or 2 dimensions."),
(not np.any(np.equal(X.shape, 0)), f"Input {input_name} shape contains a 0."),
(
dt in [np.float32, np.float64],
f"Input {input_name} dtype is not float32 or float64.",
),
]
)
_patching_status.write_log()
Expand Down

0 comments on commit 2c96011

Please sign in to comment.