I’m not sure, why the backward pass is raising the issue. If the dtype is wrong the forward should already complain. Could you still post an executable code snippet so that I could debug it, please?
Also, which PyTorch version are you using?