Skip to content

Commit

Permalink
fix meshgrid issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Dec 3, 2021
1 parent 6be0c37 commit 64ca548
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name = 'siren-pytorch',
packages = find_packages(),
version = '0.1.5',
version = '0.1.6',
license='MIT',
description = 'Implicit Neural Representations with Periodic Activation Functions',
author = 'Phil Wang',
Expand Down
4 changes: 2 additions & 2 deletions siren_pytorch/siren_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ def __init__(self, net, image_width, image_height, latent_dim = None):
num_layers = net.num_layers
)

tensors = [torch.linspace(-1, 1, steps = image_width), torch.linspace(-1, 1, steps = image_height)]
mgrid = torch.stack(torch.meshgrid(*tensors), dim=-1)
tensors = [torch.linspace(-1, 1, steps = image_height), torch.linspace(-1, 1, steps = image_width)]
mgrid = torch.stack(torch.meshgrid(*tensors, indexing = 'ij'), dim=-1)
mgrid = rearrange(mgrid, 'h w c -> (h w) c')
self.register_buffer('grid', mgrid)

Expand Down

0 comments on commit 64ca548

Please sign in to comment.