MCPcopy Create free account
hub / github.com/Standard-Intelligence/hertz-dev / init_cache

Method init_cache

model.py:130–133  ·  view source on GitHub ↗
(self, bsize, device, dtype, length:int=None)

Source from the content-addressed store, hash-verified

128 return self.quantizer(None, known_latent=token_data)
129
130 def init_cache(self, bsize, device, dtype, length:int=None):
131 cache_shape = self.cache_shape.copy()
132 cache_shape[1] = length or cache_shape[1]
133 self.cache = T.full((bsize, *cache_shape), CACHE_FILL_VALUE, device=device, dtype=dtype).transpose(0, 1)
134
135 def deinit_cache(self):
136 self.cache = [None] * self.cache_num_layers

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected