torch-dct icon indicating copy to clipboard operation
torch-dct copied to clipboard

Issue in torch 1.7.1

Open kiranchari opened this issue 3 years ago • 2 comments

Hi @zh217,

I just installed torch-dct and tried the test on the README page. I am getting an AssertionError. The value of (torch.abs(x - y)).sum() is small though: 3.0896e-05.

Any idea what maybe the issue? Happy to help. Thanks

x = torch.randn(200) X = dct.dct(x) # DCT-II done through the last dimension y = dct.idct(X) # scaled DCT-III done through the last dimension assert (torch.abs(x - y)).sum() < 1e-10 # x == y within numerical tolerance

AssertionError Traceback (most recent call last) in X = dct.dct(x) # DCT-II done through the last dimension y = dct.idct(X) # scaled DCT-III done through the last dimension assert (torch.abs(x - y)).sum() < 1e-10 # x == y within numerical tolerance

kiranchari avatar Mar 08 '21 06:03 kiranchari

Hi, I meet the same question. The scale of your input image is [0,1]?

GuoLanqing avatar Aug 08 '21 11:08 GuoLanqing

Am also seeing values around the same. For example 2.6974e-05 Probably this is good enough for most applications, and we can just update the README?

jonnor avatar Nov 07 '22 21:11 jonnor