Closed sethaxen closed 2 years ago
Makes sense, will do.
I see that https://github.com/TuringLang/ParetoSmooth.jl/commit/698bb94c8cb0850b4a8861bbef6d17296e50b888 renamed do_psis_i!
to psis!
, but it only operates on vectors and does none of the checks. My thinking RE psis!
was to have the same functionality as psis
(including performing checks) but just do so while overwriting the provided log ratios. This psis!
could be basically the same as the current psis
, and psis
would then be reimplemented as just allocating the new output vector and then calling psis!
. See for example how PSIS.jl does it.
An orthogonal issue is check handling. e.g., an keyword like checks=true
could be provided to psis
and psis!
thst could be set to false
to disable all checks
Done!
It wouldn't be completely allocation-free, as some allocations are needed (e.g. to compute profile log-likelihood), but it would at least cut down on the biggest allocation; a copy of log ratios.