cbd:

Is kernel density estimation function available in pytorch?


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.