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)
| 368 | return SparseTensor(feats=feats, coords=coords) |
| 369 | |
| 370 | def register_spatial_cache(self, key, value) -> None: |
| 371 | """ |
| 372 | Register a spatial cache. |
| 373 | The spatial cache can be any thing you want to cache. |
| 374 | The registery and retrieval of the cache is based on current scale. |
| 375 | """ |
| 376 | scale_key = str(self._scale) |
| 377 | if scale_key not in self._spatial_cache: |
| 378 | self._spatial_cache[scale_key] = {} |
| 379 | self._spatial_cache[scale_key][key] = value |
| 380 | |
| 381 | def get_spatial_cache(self, key=None): |
| 382 | """ |
no outgoing calls
no test coverage detected