Exemple #1
0
 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
Exemple #2
0
 def device(self):
     if self.use_gpu and self.gpu_device is not None:
         return torch.cuda.device(self.gpu_device)
     else:
         return Dummy()
Exemple #3
0
 def clone(self):
     obj = Dummy()
     obj.__class__ = self.__class__
     obj.vertices = self.vertices[:]
     obj.color = self.color
     return obj