textures device consistency

Summary: Ensure that `mesh2 = mesh.to(device)` doesn't change the device of `mesh.textures`.

Reviewed By: nikhilaravi

Differential Revision: D25978610

fbshipit-source-id: 0558cd62132965d8693ebeea05e42b8c1d16cfbf
This commit is contained in:
Jeremy Reizenstein
2021-01-25 06:08:09 -08:00
committed by Facebook GitHub Bot
parent e58a730e6a
commit d173a2f8da
3 changed files with 25 additions and 9 deletions

View File

@@ -1197,7 +1197,7 @@ class Meshes(object):
if torch.is_tensor(v):
setattr(other, k, v.to(device))
if self.textures is not None:
other.textures = self.textures.to(device)
other.textures = other.textures.to(device)
return other
def cpu(self):