MCPcopy
hub / github.com/TencentARC/Pixal3D / register_spatial_cache

Method register_spatial_cache

pixal3d/modules/sparse/basic.py:773–782  ·  view source on GitHub ↗

Register a spatial cache. The spatial cache can be any thing you want to cache. The registery and retrieval of the cache is based on current scale.

(self, key, value)

Source from the content-addressed store, hash-verified

771 self._spatial_cache = {}
772
773 def register_spatial_cache(self, key, value) -> None:
774 """
775 Register a spatial cache.
776 The spatial cache can be any thing you want to cache.
777 The registery and retrieval of the cache is based on current scale.
778 """
779 scale_key = str(self._scale)
780 if scale_key not in self._spatial_cache:
781 self._spatial_cache[scale_key] = {}
782 self._spatial_cache[scale_key][key] = value
783
784 def get_spatial_cache(self, key=None):
785 """

Callers 15

layoutMethod · 0.95
spatial_shapeMethod · 0.95
seqlenMethod · 0.95
cum_seqlenMethod · 0.95
batch_boardcast_mapMethod · 0.95
__getitem__Method · 0.95
forwardMethod · 0.95
forwardMethod · 0.95
sparse_conv3d_forwardFunction · 0.95
forwardMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected