MCPcopy Create free account
hub / github.com/huggingface/diffusers / is_flash_attn_version

Function is_flash_attn_version

src/diffusers/utils/import_utils.py:908–920  ·  view source on GitHub ↗

Compares the current flash-attention version to a given reference with an operation. Args: operation (`str`): A string representation of an operator, such as `">"` or `"<="` version (`str`): A version string

(operation: str, version: str)

Source from the content-addressed store, hash-verified

906
907@cache
908def is_flash_attn_version(operation: str, version: str):
909 """
910 Compares the current flash-attention version to a given reference with an operation.
911
912 Args:
913 operation (`str`):
914 A string representation of an operator, such as `">"` or `"<="`
915 version (`str`):
916 A version string
917 """
918 if not _flash_attn_available:
919 return False
920 return compare_versions(parse(_flash_attn_version), operation, version)
921
922
923@cache

Callers 1

Calls 1

compare_versionsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…