| 167 | self = self.to(self.device) |
| 168 | |
| 169 | def to(self, device): |
| 170 | if isinstance(device, str): |
| 171 | device = torch.device(device) |
| 172 | self.device = device |
| 173 | if getattr(self.rasterizer, 'cameras', None) is not None: |
| 174 | self.rasterizer.cameras = self.rasterizer.cameras.to(device) |
| 175 | |
| 176 | if getattr(self.shader, 'cameras', None) is not None: |
| 177 | self.shader.cameras = self.shader.cameras.to(device) |
| 178 | if getattr(self.shader, 'materials', None) is not None: |
| 179 | self.shader.materials = self.shader.materials.to(device) |
| 180 | if getattr(self.shader, 'lights', None) is not None: |
| 181 | self.shader.lights = self.shader.lights.to(device) |
| 182 | return self |
| 183 | |
| 184 | def _set_output_path(self, output_path): |
| 185 | if output_path is not None: |