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)
| 826 | |
| 827 | @cache |
| 828 | def 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 |
no test coverage detected
searching dependent graphs…