Storing the partial derivatives into the weights structure is quite the hack, to be honest. But everybody seems to do it like that.