Commit 5b74a2cc authored by Krzysztof Chalupka's avatar Krzysztof Chalupka Committed by Facebook GitHub Bot
Browse files

Remove use of torch.tile to fix CI

Summary: Our tests fail (https://fburl.com/jmoqo9bz) because test_splatter_blend uses torch.tile, which is not supported in earlier torch versions. Replace it with tensor.extend.

Reviewed By: bottler

Differential Revision: D36796098

fbshipit-source-id: 38d5b40667f98f3163b33f44e53e96b858cfeba2
parent 49ed7b07
......@@ -7,7 +7,7 @@
import unittest
import torch
from common_testing import TestCaseMixin
from pytorch3d.common.compat import meshgrid_ij
from pytorch3d.renderer.cameras import FoVPerspectiveCameras
from pytorch3d.renderer.splatter_blend import (
_compute_occlusion_layers,
......@@ -20,6 +20,8 @@ from pytorch3d.renderer.splatter_blend import (
_prepare_pixels_and_colors,
)
from .common_testing import TestCaseMixin
offsets = torch.tensor(
[
[-1, -1],
......@@ -248,15 +250,13 @@ class TestComputeSplattingColorsAndWeights(TestCaseMixin, unittest.TestCase):
def setUp(self):
self.N, self.H, self.W, self.K = 2, 3, 4, 5
self.pixel_coords_screen = (
torch.tile(
torch.stack(
torch.meshgrid(
torch.arange(self.H), torch.arange(self.W), indexing="ij"
),
meshgrid_ij(torch.arange(self.H), torch.arange(self.W)),
dim=-1,
).reshape(1, self.H, self.W, 1, 2),
(self.N, 1, 1, self.K, 1),
).float()
)
.reshape(1, self.H, self.W, 1, 2)
.expand(self.N, self.H, self.W, self.K, 2)
.float()
+ 0.5
)
self.colors = torch.ones((self.N, self.H, self.W, self.K, 4))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment