Could you remove the .data usage in:
p.data[bias_size // 4:bias_size // 2].fill_(self.forget_bias)

and replace it with the no_grad() guard as suggested in the error message?
The usage of the .data attribute could break your code in various ways and is thus not recommended (and apparently now even disallowed).