Skip to content

Commit b1a4510

Browse files
committed
Relax condition on inputs for kernelmatrix
1 parent c50ebe1 commit b1a4510

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/matrix/kernelmatrix.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function kernelmatrix(κ::SimpleKernel, x::AbstractVector)
8989
end
9090

9191
function kernelmatrix::SimpleKernel, x::AbstractVector, y::AbstractVector)
92-
validate_dims(x, y)
92+
validate_inputs(x, y)
9393
return map(d -> kappa(κ, d), pairwise(metric(κ), x, y))
9494
end
9595

src/utils.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ function validate_inplace_dims(K::AbstractVector, x::AbstractVector)
118118
end
119119
end
120120

121-
function validate_dims(x::AbstractVector, y::AbstractVector)
121+
validate_inputs(x, y) = nothing
122+
123+
function validate_inputs(x::V, y::V) where {V<:Union{RowVecs, ColVecs}}
122124
if dim(x) != dim(y)
123125
throw(DimensionMismatch(
124126
"Dimensionality of x ($(dim(x))) not equality to that of y ($(dim(y)))",

0 commit comments

Comments
 (0)