Commit 9c5ab571 authored by ywang's avatar ywang Committed by Facebook GitHub Bot
Browse files

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