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

Method get_conv_state

deepspeed/utils/static_cache.py:436–442  ·  view source on GitHub ↗

HF >= 5.19 GDN cache protocol bridge: the native (non-segKI) forward fetches conv/recurrent state through these top-level entries; pre-5.19 builds poke layer attributes directly, which the slot's attribute forwarding already serves.

(self, layer_idx: int, state_idx: int = 0)

Source from the content-addressed store, hash-verified

434 return self._layers[layer_idx].update_conv_state(conv_state, state_idx=0, **kwargs)
435
436 def get_conv_state(self, layer_idx: int, state_idx: int = 0):
437 """HF >= 5.19 GDN cache protocol bridge: the native (non-segKI)
438 forward fetches conv/recurrent state through these top-level
439 entries; pre-5.19 builds poke layer attributes directly, which the
440 slot's attribute forwarding already serves."""
441 layer = self._layers[layer_idx]
442 return layer.conv_states[state_idx]
443
444 def get_recurrent_state(self, layer_idx: int, state_idx: int = 0):
445 layer = self._layers[layer_idx]

Calls

no outgoing calls