Skip to content

Commit

Permalink
fix: changed the condition to the proper torch version (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
denproc authored Apr 16, 2021
1 parent 6e9cdec commit 06ab982
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion piq/fsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def _phase_congruency(x: torch.Tensor, scales: int = 4, orientations: int = 4,

# Fourier transform
filters = _construct_filters(x, scales, orientations, min_length, mult, sigma_f, delta_theta, k)
recommended_torch_version = '1.7.0'
recommended_torch_version = '1.8.0'
if _version_tuple(torch.__version__) >= _version_tuple(recommended_torch_version):
imagefft = torch.fft.fft2(x)
filters_ifft = torch.fft.ifft2(filters)
Expand Down
2 changes: 1 addition & 1 deletion piq/vsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def sdsp(x: torch.Tensor, data_range: Union[int, float] = 255, omega_0: float =
x_lab = rgb2lab(x, data_range=255)

lg = _log_gabor(size_to_use, omega_0, sigma_f).to(x).view(1, 1, *size_to_use)
recommended_torch_version = '1.7.0'
recommended_torch_version = '1.8.0'
if _version_tuple(torch.__version__) >= _version_tuple(recommended_torch_version):
x_fft = torch.fft.fft2(x_lab)
x_ifft_real = torch.fft.ifft2(x_fft * lg).real
Expand Down

0 comments on commit 06ab982

Please sign in to comment.