badripatro / simba

Simba
156 stars 15 forks source link

UserWarning: Casting complex values to real discards the imaginary part #1

Closed Charlie839242 closed 3 months ago

Charlie839242 commented 3 months ago

Hi, thanks for sharing your great work! I am wondering if this warning is normal: UserWarning: Casting complex values to real discards the imaginary part Looking forward to your reply!

waynechu1021 commented 3 months ago

Hi, thanks for sharing your great work! I am wondering if this warning is normal: UserWarning: Casting complex values to real discards the imaginary part Looking forward to your reply!

I got the same problem, but changing the "x = x.to(torch.float32)" to "x = x.real" would not cause the warning while keeping the same output. I don't know whether it's right but wish this could help u.

badripatro commented 3 months ago

Hi, Yes, the user warning is okay. There are no issues. Alternatively, you can change fft2 to rfft2 and adjust the parameters (such as complex_weights) accordingly.