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)
| 699 | |
| 700 | @cache |
| 701 | def 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 |
no test coverage detected
searching dependent graphs…