Kernel density estimation in Pytorch

Is kernel density estimation function available in pytorch?

If not i need to use detach during conversion from tensor to numpy for kernel density estimation function but it want back propagate gradient. Is there any workaround solution?

No. You will usually need more specialized routines depending on what is trained (knots, bandwidth, density of observations). Mixture density networks or cubic splines could work as “workarounds”, but these are not bundled either of course.