def clone(self, **extra): obj = Dummy() obj.__class__ = self.__class__ obj.polys = [x.clone() for x in self.polys] obj.start = self.start obj.size = self.size obj.orig = self.orig obj.__dict__.update(extra) return obj
def device(self): if self.use_gpu and self.gpu_device is not None: return torch.cuda.device(self.gpu_device) else: return Dummy()
def clone(self): obj = Dummy() obj.__class__ = self.__class__ obj.vertices = self.vertices[:] obj.color = self.color return obj