What is the advantage/use case of using a vector for the variance here?
|
struct ScaledKernel{Tk<:Kernel,Tσ²<:Real} <: Kernel |
|
kernel::Tk |
|
σ²::Vector{Tσ²} |
|
end |
|
|
|
function ScaledKernel(kernel::Tk, σ²::Tσ²=1.0) where {Tk<:Kernel,Tσ²<:Real} |
|
@check_args(ScaledKernel, σ², σ² > zero(Tσ²), "σ² > 0") |
|
return ScaledKernel{Tk,Tσ²}(kernel, [σ²]) |
|
end |
It seems to me that the allocations just hurt performance without any benefit.
Shall we get rid of it?
What is the advantage/use case of using a vector for the variance here?
KernelFunctions.jl/src/kernels/scaledkernel.jl
Lines 14 to 22 in 1831cc6
It seems to me that the allocations just hurt performance without any benefit.
Shall we get rid of it?