(aabb, dim, value, dtype=torch.float32, device=None)
| 690 | |
| 691 | @staticmethod |
| 692 | def full(aabb, dim, value, dtype=torch.float32, device=None) -> 'SparseTensor': |
| 693 | N, C = dim |
| 694 | x = torch.arange(aabb[0], aabb[3] + 1) |
| 695 | y = torch.arange(aabb[1], aabb[4] + 1) |
| 696 | z = torch.arange(aabb[2], aabb[5] + 1) |
| 697 | coords = torch.stack(torch.meshgrid(x, y, z, indexing='ij'), dim=-1).reshape(-1, 3) |
| 698 | coords = torch.cat([ |
| 699 | torch.arange(N).view(-1, 1).repeat(1, coords.shape[0]).view(-1, 1), |
| 700 | coords.repeat(N, 1), |
| 701 | ], dim=1).to(dtype=torch.int32, device=device) |
| 702 | feats = torch.full((coords.shape[0], C), value, dtype=dtype, device=device) |
| 703 | return SparseTensor(feats=feats, coords=coords) |
| 704 | |
| 705 | def __merge_sparse_cache(self, other: 'SparseTensor') -> dict: |
| 706 | new_cache = {} |
no test coverage detected