The RuntimeError claims that the first argument to the operation is the “right” one and the second argument has the wrong data type.
In this case the second argument is the weight as seen in the stack trace, which explains the error message.