fix an issue of cov operation

This commit is contained in:
jin-xiulang 2022-11-07 21:59:17 +08:00
parent c0574a1dd6
commit 8ee19ab21c
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.")