Thanks for explanation, @alexis-jacq. However, it is still unclear to me.
If there is a reward function that has zero or negative values, e.g. reward=[-1, 0, +1], how math will work out in this line 3? Because when the reward is zero, loss becomes zero, so means no error? but when the reward is +1 (desired one), there is an error?
Or may be the reward can not be negative or zero in this code?