Thanks for the reply. Sorry, I should have been more precise. By saying ’ it is not possible to do any interpolation in y_true', I meant that it is not possible to generate values of y_true at fractional indices by interpolation, such as y_true[3.5,4.5]. That is why the rounding is needed. So in a nutshell, I was wondering on how to compute the loss with a list (y_pred) of fractional indices. But I am guessing this is getting away from the topic of discussion in this post, I might make a separate post then.