PyTorch 1.7 compatibility

Summary: Small changes discovered based on circleCI failures.

Reviewed By: patricklabatut

Differential Revision: D34426807

fbshipit-source-id: 819860f34b2f367dd24057ca7490284204180a13
This commit is contained in:
Jeremy Reizenstein
2022-02-25 07:53:34 -08:00
committed by Facebook GitHub Bot
parent f816568735
commit 4d043fc9ac
9 changed files with 34 additions and 23 deletions

View File

@@ -7,6 +7,7 @@
import torch
import torch.nn.functional as F
from pytorch3d.common.compat import meshgrid_ij
from pytorch3d.structures import Meshes
@@ -195,9 +196,7 @@ def cubify(voxels, thresh, device=None, align: str = "topleft") -> Meshes:
# NF x 3
grid_faces = torch.stack(grid_faces, dim=1)
y, x, z = torch.meshgrid(
torch.arange(H + 1), torch.arange(W + 1), torch.arange(D + 1)
)
y, x, z = meshgrid_ij(torch.arange(H + 1), torch.arange(W + 1), torch.arange(D + 1))
y = y.to(device=device, dtype=torch.float32)
x = x.to(device=device, dtype=torch.float32)
z = z.to(device=device, dtype=torch.float32)