(self, device: torch.device)
| 122 | return self.valid_mask[bidx, :].sum().detach().cpu().item() |
| 123 | |
| 124 | def to(self, device: torch.device) -> 'PointCloud': |
| 125 | for attr_name in self.attr_names: |
| 126 | arr = getattr(self, attr_name, None) |
| 127 | if arr is not None: |
| 128 | setattr(self, attr_name, arr.to(device=device)) |
| 129 | return self |
| 130 | |
| 131 | def detach(self) -> 'PointCloud': |
| 132 | for attr_name in self.attr_names: |