From b51be58f634698486c1b283c1094d82748473b75 Mon Sep 17 00:00:00 2001 From: Jeremy Reizenstein Date: Tue, 21 Dec 2021 04:45:10 -0800 Subject: [PATCH] validate sampling_mode Summary: New sampling mode option in TexturesUV mush match when collating meshes. Reviewed By: patricklabatut Differential Revision: D33235901 fbshipit-source-id: f457473d90bf022e65fe122ef45bf5efad134345 --- pytorch3d/renderer/mesh/textures.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pytorch3d/renderer/mesh/textures.py b/pytorch3d/renderer/mesh/textures.py index 3407d8635..58abf5b71 100644 --- a/pytorch3d/renderer/mesh/textures.py +++ b/pytorch3d/renderer/mesh/textures.py @@ -1061,6 +1061,11 @@ def join_batch(self, textures: List["TexturesUV"]) -> "TexturesUV": ) if not align_corners_same: raise ValueError("All textures must have the same align_corners value.") + sampling_mode_same = all( + tex.sampling_mode == self.sampling_mode for tex in textures + ) + if not sampling_mode_same: + raise ValueError("All textures must have the same sampling_mode.") verts_uvs_list = [] faces_uvs_list = []