mirror of
				https://github.com/facebookresearch/pytorch3d.git
				synced 2025-11-04 18:02:14 +08:00 
			
		
		
		
	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
This commit is contained in:
		
							parent
							
								
									49ed7b07b1
								
							
						
					
					
						commit
						5b74a2cc27
					
				@ -7,7 +7,7 @@
 | 
				
			|||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import torch
 | 
					import torch
 | 
				
			||||||
from common_testing import TestCaseMixin
 | 
					from pytorch3d.common.compat import meshgrid_ij
 | 
				
			||||||
from pytorch3d.renderer.cameras import FoVPerspectiveCameras
 | 
					from pytorch3d.renderer.cameras import FoVPerspectiveCameras
 | 
				
			||||||
from pytorch3d.renderer.splatter_blend import (
 | 
					from pytorch3d.renderer.splatter_blend import (
 | 
				
			||||||
    _compute_occlusion_layers,
 | 
					    _compute_occlusion_layers,
 | 
				
			||||||
@ -20,6 +20,8 @@ from pytorch3d.renderer.splatter_blend import (
 | 
				
			|||||||
    _prepare_pixels_and_colors,
 | 
					    _prepare_pixels_and_colors,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from .common_testing import TestCaseMixin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
offsets = torch.tensor(
 | 
					offsets = torch.tensor(
 | 
				
			||||||
    [
 | 
					    [
 | 
				
			||||||
        [-1, -1],
 | 
					        [-1, -1],
 | 
				
			||||||
@ -248,15 +250,13 @@ class TestComputeSplattingColorsAndWeights(TestCaseMixin, unittest.TestCase):
 | 
				
			|||||||
    def setUp(self):
 | 
					    def setUp(self):
 | 
				
			||||||
        self.N, self.H, self.W, self.K = 2, 3, 4, 5
 | 
					        self.N, self.H, self.W, self.K = 2, 3, 4, 5
 | 
				
			||||||
        self.pixel_coords_screen = (
 | 
					        self.pixel_coords_screen = (
 | 
				
			||||||
            torch.tile(
 | 
					 | 
				
			||||||
            torch.stack(
 | 
					            torch.stack(
 | 
				
			||||||
                    torch.meshgrid(
 | 
					                meshgrid_ij(torch.arange(self.H), torch.arange(self.W)),
 | 
				
			||||||
                        torch.arange(self.H), torch.arange(self.W), indexing="ij"
 | 
					 | 
				
			||||||
                    ),
 | 
					 | 
				
			||||||
                dim=-1,
 | 
					                dim=-1,
 | 
				
			||||||
                ).reshape(1, self.H, self.W, 1, 2),
 | 
					            )
 | 
				
			||||||
                (self.N, 1, 1, self.K, 1),
 | 
					            .reshape(1, self.H, self.W, 1, 2)
 | 
				
			||||||
            ).float()
 | 
					            .expand(self.N, self.H, self.W, self.K, 2)
 | 
				
			||||||
 | 
					            .float()
 | 
				
			||||||
            + 0.5
 | 
					            + 0.5
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
        self.colors = torch.ones((self.N, self.H, self.W, self.K, 4))
 | 
					        self.colors = torch.ones((self.N, self.H, self.W, self.K, 4))
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user