MCPcopy Index your code
hub / github.com/microsoft/TRELLIS / __merge_sparse_cache

Method __merge_sparse_cache

trellis/modules/sparse/basic.py:290–300  ·  view source on GitHub ↗
(self, other: 'SparseTensor')

Source from the content-addressed store, hash-verified

288 return SparseTensor(feats=feats, coords=coords)
289
290 def __merge_sparse_cache(self, other: 'SparseTensor') -> dict:
291 new_cache = {}
292 for k in set(list(self._spatial_cache.keys()) + list(other._spatial_cache.keys())):
293 if k in self._spatial_cache:
294 new_cache[k] = self._spatial_cache[k]
295 if k in other._spatial_cache:
296 if k not in new_cache:
297 new_cache[k] = other._spatial_cache[k]
298 else:
299 new_cache[k].update(other._spatial_cache[k])
300 return new_cache
301
302 def __neg__(self) -> 'SparseTensor':
303 return self.replace(-self.feats)

Callers 1

__elemwise__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected