MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / update

Method update

deepspeed/utils/static_cache.py:292–302  ·  view source on GitHub ↗
(
        self,
        key_states: torch.Tensor,
        value_states: torch.Tensor,
        layer_idx: int,
        *args,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

290 layer._trim_left(count)
291
292 def update(
293 self,
294 key_states: torch.Tensor,
295 value_states: torch.Tensor,
296 layer_idx: int,
297 *args,
298 **kwargs,
299 ) -> tuple[torch.Tensor, torch.Tensor]:
300 if layer_idx >= len(self._layers):
301 raise IndexError(f"layer_idx {layer_idx} out of range (cache has {len(self._layers)} layers)")
302 return self._layers[layer_idx].update(key_states, value_states, *args, **kwargs)
303
304 def early_initialization(
305 self,

Callers

nothing calls this directly

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected