| 703 | return SparseTensor(feats=feats, coords=coords) |
| 704 | |
| 705 | def __merge_sparse_cache(self, other: 'SparseTensor') -> dict: |
| 706 | new_cache = {} |
| 707 | for k in set(list(self._spatial_cache.keys()) + list(other._spatial_cache.keys())): |
| 708 | if k in self._spatial_cache: |
| 709 | new_cache[k] = self._spatial_cache[k] |
| 710 | if k in other._spatial_cache: |
| 711 | if k not in new_cache: |
| 712 | new_cache[k] = other._spatial_cache[k] |
| 713 | else: |
| 714 | new_cache[k].update(other._spatial_cache[k]) |
| 715 | return new_cache |
| 716 | |
| 717 | def __elemwise__(self, other: Union[torch.Tensor, VarLenTensor], op: callable) -> 'SparseTensor': |
| 718 | if isinstance(other, torch.Tensor): |