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

Function is_torchao_version

src/diffusers/utils/import_utils.py:828–840  ·  view source on GitHub ↗

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

826
827@cache
828def is_torchao_version(operation: str, version: str):
829 """
830 Compares the current torchao version to a given reference with an operation.
831
832 Args:
833 operation (`str`):
834 A string representation of an operator, such as `">"` or `"<="`
835 version (`str`):
836 A version string
837 """
838 if not _torchao_available:
839 return False
840 return compare_versions(parse(_torchao_version), operation, version)
841
842
843@cache

Callers 4

post_initMethod · 0.85
from_dictMethod · 0.85

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…