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;
20042004 atol:: Real = 0 ,
20052005 rtol:: Real = Base. rtoldefault (promote_leaf_eltypes (x),promote_leaf_eltypes (y),atol),
20062006 nans:: Bool = false , norm:: Function = norm)
2007+ Base. promote_shape (size (x), size (y)) # ensure compatible size
20072008 d = if isempty (x) && isempty (y)
2008- Base. promote_shape (size (x), size (y)) # ensure same size
20092009 norm (zero (eltype (x)) - zero (eltype (y)))
20102010 else
20112011 norm_x_minus_y (x, y)
@@ -2020,8 +2020,8 @@ function isapprox(x::AbstractArray, y::AbstractArray;
20202020end
20212021
20222022norm_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 )
20252025 norm (Iterators. map (splat (- ), zip (x,y)))
20262026end
20272027
You can’t perform that action at this time.
0 commit comments