That’s not a very helpful message.
The error comes from the expanded parameter inside your model and you could avoid it by calling .contiguous() on it or use repeat instead of expand.
Also, since your parameter does not require gradients, you could register a buffer instead (via self.register_buffer). If you want to update this parameter (and set requires_grad=True), you’ll most likely get an error claiming:

RuntimeError: unsupported operation: more than one element of the written-to tensor refers to a single memory location. Please clone() the tensor before performing the operation.

Would you mind creating an issue on GitHub?