Ah, I see. I got that part wrong. I misread Sigmoid for Linear.  But you got it right.



 Kushagra_Bhatia:

I have already tried doing hq=hq.float() and hq=torch.tensor(hq,dtype=torch.float32)


Did you try double or float64 instead?