MCPcopy Index your code
hub / github.com/huggingface/diffusers / is_kernels_version

Function is_kernels_version

src/diffusers/utils/import_utils.py:733–745  ·  view source on GitHub ↗

Compares the current Kernels 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

731
732@cache
733def is_kernels_version(operation: str, version: str):
734 """
735 Compares the current Kernels version to a given reference with an operation.
736
737 Args:
738 operation (`str`):
739 A string representation of an operator, such as `">"` or `"<="`
740 version (`str`):
741 A version string
742 """
743 if not _kernels_available:
744 return False
745 return compare_versions(parse(_kernels_version), operation, version)
746
747
748@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…