Skip to content

Commit

Permalink
fix kornia
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Feb 1, 2022
1 parent 39223be commit e8f8700
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lightweight_gan/diff_augment.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def rand_translation(x, ratio=0.125):
torch.arange(x.size(0), dtype=torch.long, device=x.device),
torch.arange(x.size(2), dtype=torch.long, device=x.device),
torch.arange(x.size(3), dtype=torch.long, device=x.device),
)
indexing = 'ij')
grid_x = torch.clamp(grid_x + translation_x + 1, 0, x.size(2) + 1)
grid_y = torch.clamp(grid_y + translation_y + 1, 0, x.size(3) + 1)
x_pad = F.pad(x, [1, 1, 1, 1, 0, 0, 0, 0])
Expand Down Expand Up @@ -84,7 +84,7 @@ def rand_cutout(x, ratio=0.5):
torch.arange(x.size(0), dtype=torch.long, device=x.device),
torch.arange(cutout_size[0], dtype=torch.long, device=x.device),
torch.arange(cutout_size[1], dtype=torch.long, device=x.device),
)
indexing = 'ij')
grid_x = torch.clamp(grid_x + offset_x - cutout_size[0] // 2, min=0, max=x.size(2) - 1)
grid_y = torch.clamp(grid_y + offset_y - cutout_size[1] // 2, min=0, max=x.size(3) - 1)
mask = torch.ones(x.size(0), x.size(2), x.size(3), dtype=x.dtype, device=x.device)
Expand Down
2 changes: 1 addition & 1 deletion lightweight_gan/lightweight_gan.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from PIL import Image
import torchvision
from torchvision import transforms
from kornia import filter2d
from kornia.filters import filter2d

from lightweight_gan.diff_augment import DiffAugment
from lightweight_gan.version import __version__
Expand Down
2 changes: 1 addition & 1 deletion lightweight_gan/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.20.6'
__version__ = '0.20.7'

0 comments on commit e8f8700

Please sign in to comment.