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

Function is_torch_xla_version

src/diffusers/utils/import_utils.py:701–713  ·  view source on GitHub ↗

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

(operation: str, version: str)

Source from the content-addressed store, hash-verified

699
700@cache
701def is_torch_xla_version(operation: str, version: str):
702 """
703 Compares the current torch_xla version to a given reference with an operation.
704
705 Args:
706 operation (`str`):
707 A string representation of an operator, such as `">"` or `"<="`
708 version (`str`):
709 A string version of torch_xla
710 """
711 if not is_torch_xla_available:
712 return False
713 return compare_versions(parse(_torch_xla_version), operation, version)
714
715
716@cache

Callers 5

__init__Method · 0.85
__new__Method · 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…