Solved by ptrblck in post #2 
              
              
                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_buff…