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

Method update

deepspeed/utils/static_cache.py:185–195  ·  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

183 layer.set_write_position(pos)
184
185 def update(
186 self,
187 key_states: torch.Tensor,
188 value_states: torch.Tensor,
189 layer_idx: int,
190 *args,
191 **kwargs,
192 ) -> tuple[torch.Tensor, torch.Tensor]:
193 if layer_idx >= len(self._layers):
194 raise IndexError(f"layer_idx {layer_idx} out of range (cache has {len(self._layers)} layers)")
195 return self._layers[layer_idx].update(key_states, value_states, *args, **kwargs)
196
197 def early_initialization(
198 self,

Callers

nothing calls this directly

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected