Thanks a lot for your help, @SimonW !
With the register buffer for the loss function, i.e. mel_basis, what moves the buffer to the GPU device? Note that mel_basis is not part of a model but part of a loss function.