File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -2004,8 +2004,8 @@ function isapprox(x::AbstractArray, y::AbstractArray;
2004
2004
atol:: Real = 0 ,
2005
2005
rtol:: Real = Base. rtoldefault (promote_leaf_eltypes (x),promote_leaf_eltypes (y),atol),
2006
2006
nans:: Bool = false , norm:: Function = norm)
2007
+ Base. promote_shape (size (x), size (y)) # ensure compatible size
2007
2008
d = if isempty (x) && isempty (y)
2008
- Base. promote_shape (size (x), size (y)) # ensure same size
2009
2009
norm (zero (eltype (x)) - zero (eltype (y)))
2010
2010
else
2011
2011
norm_x_minus_y (x, y)
@@ -2020,8 +2020,8 @@ function isapprox(x::AbstractArray, y::AbstractArray;
2020
2020
end
2021
2021
2022
2022
norm_x_minus_y (x, y) = norm (x - y)
2023
- function norm_x_minus_y (x :: Array , y :: Array )
2024
- Base . promote_shape ( size (x), size (y)) # ensure same size
2023
+ const ArrayOrFastContiguousSubArrayStrided = Union{ Array, FastContiguousSubArrayStrided}
2024
+ function norm_x_minus_y (x :: ArrayOrFastContiguousSubArrayStrided , y :: ArrayOrFastContiguousSubArrayStrided )
2025
2025
norm (Iterators. map (splat (- ), zip (x,y)))
2026
2026
end
2027
2027
You can’t perform that action at this time.
0 commit comments