MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / __init__

Method __init__

lightx2v/common/kvcache/base.py:8–22  ·  view source on GitHub ↗
(
        self,
        num_layers: int,
        cache_size: int,
        num_heads: int,
        head_dim: int,
        dtype: torch.dtype,
        device: torch.device,
    )

Source from the content-addressed store, hash-verified

6from lightx2v.common.ops.attn.utils.all2all import all2all_head2seq, all2all_seq2head
7
8
9class KVCacheView(NamedTuple):
10 key: torch.Tensor
11 value: torch.Tensor
12
13 @property
14 def bindings(self) -> tuple[torch.Tensor, ...]:
15 return self.key, self.value
16
17
18class BaseKVCachePool:
19 def __init__(
20 self,
21 num_layers: int,
22 cache_size: int,
23 num_heads: int,
24 head_dim: int,
25 dtype: torch.dtype,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected