You can give your model any data type you like so long as your .forward method knows what to do with it.
The error you are seeing is likely related to an error inside your forward method.
Could you post the code for the forward method and the full stack trace of the error?