MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / init_cache

Method init_cache

diffsynth/models/wan_video_dit.py:410–413  ·  view source on GitHub ↗

ctx: [B, S_ctx, dim] —— 经过 text_embedding 之后的上下文

(self, ctx: torch.Tensor)

Source from the content-addressed store, hash-verified

408
409 @torch.no_grad()
410 def init_cache(self, ctx: torch.Tensor):
411 """ctx: [B, S_ctx, dim] —— 经过 text_embedding 之后的上下文"""
412 self.cache_k = self.norm_k(self.k(ctx))
413 self.cache_v = self.v(ctx)
414
415 def clear_cache(self):
416 self.cache_k = None

Callers 1

reinit_cross_kvMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected