From 9c5ab571566178195bf0bedc0ee266df40ce1de1 Mon Sep 17 00:00:00 2001 From: ywang Date: Tue, 5 May 2020 22:29:07 -0700 Subject: [PATCH] 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 --- pytorch3d/renderer/lighting.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pytorch3d/renderer/lighting.py b/pytorch3d/renderer/lighting.py index fbcd1aec..99fe4548 100644 --- a/pytorch3d/renderer/lighting.py +++ b/pytorch3d/renderer/lighting.py @@ -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: