MCPcopy Index your code
hub / github.com/TencentARC/Pixal3D / __merge_sparse_cache

Method __merge_sparse_cache

pixal3d/modules/sparse/basic.py:705–715  ·  view source on GitHub ↗
(self, other: 'SparseTensor')

Source from the content-addressed store, hash-verified

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):

Callers 1

__elemwise__Method · 0.95

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected