MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / use_flash_2

Function use_flash_2

k_diffusion/models/modules.py:357–366  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

355
356
357def use_flash_2(x):
358 if not flags.get_use_flash_attention_2():
359 return False
360 if flash_attn is None:
361 return False
362 if x.device.type != "cuda":
363 return False
364 if x.dtype not in (torch.float16, torch.bfloat16):
365 return False
366 return True
367
368
369class SelfAttentionBlock(nn.Module):

Callers 2

forwardMethod · 0.90
forwardMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected