!45249 fix an issue of cov operation

Merge pull request !45249 from jxlang910/master
This commit is contained in:
i-robot 2022-11-08 01:55:39 +00:00 committed by Gitee
commit 9e1f49bff2
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 2 additions and 0 deletions

View File

@ -2269,6 +2269,8 @@ def _handle_inputs(cov_input, rowvar):
if cov_input.ndim > 2:
_raise_value_error("input array has dimension more than 2.")
cov_input = cov_input.astype("float32")
if cov_input.size == 0:
_raise_value_error("The value of cov_input should not be None, but got {}.".format(cov_input))
cov_input = _expand(cov_input, 2)
if not isinstance(rowvar, bool):
_raise_type_error("input rowvar should be boolean.")