I would suggest either changing this, or perhaps better, skipping it all together.
|
dim(x::AbstractVector{<:AbstractVector{<:Real}}) = length(first(x)) |
I'm developing kernels that work on pairs of Vector{Float64}, where the kernel essentially sums over all pairwise distances in x and y. For this kernel, the check above does not really make sense, and indeed passes if I construct the kernel matrix like this:
K = kernelmatrix(kernel, x,x)
However it fails if I instead do
K = kernelmatrix(kernel, x,y)
unless length(first(x))==length(first(y)). I realise that I can just create my own type essentially wrapping Vector{Vector{Float64}}, but that seems like unnecessary work, especially since the kernel machinery works beautifully as it is, as long as the inputs pass the validation.