added conversion of other_side to numpy array

This commit is contained in:
poulami-sau 2024-04-21 20:40:46 -04:00
parent 63d985c6d3
commit c07752649f
1 changed files with 3 additions and 0 deletions

View File

@ -163,6 +163,9 @@ class ApproxNumpy(ApproxBase):
self._approx_scalar, self.expected.tolist()
)
# convert other_side to numpy array to ensure shape attribute is available
other_side = _as_numpy_array(other_side)
if np_array_shape != other_side.shape:
return [
"Impossible to compare arrays with different shapes.",