fix clone type issue (#179)

Summary:
a quick fix for the clone issue

fixes https://github.com/facebookresearch/pytorch3d/issues/178
Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/179

Reviewed By: bottler

Differential Revision: D21414309

Pulled By: nikhilaravi

fbshipit-source-id: 359d7724aa5d78bc88a0a9ffc05e6041056e3b3f
This commit is contained in:
ywang 2020-05-05 22:29:07 -07:00 committed by Facebook GitHub Bot
parent a61c9376d5
commit 9c5ab57156

View File

@ -185,7 +185,7 @@ class DirectionalLights(TensorProperties):
raise ValueError(msg % repr(self.direction.shape))
def clone(self):
other = DirectionalLights(device=self.device)
other = self.__class__(device=self.device)
return super().clone(other)
def diffuse(self, normals, points=None) -> torch.Tensor:
@ -244,7 +244,7 @@ class PointLights(TensorProperties):
raise ValueError(msg % repr(self.location.shape))
def clone(self):
other = PointLights(device=self.device)
other = self.__class__(device=self.device)
return super().clone(other)
def diffuse(self, normals, points) -> torch.Tensor: