Compares the current Nvidia ModelOpt 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)
| 858 | |
| 859 | @cache |
| 860 | def is_nvidia_modelopt_version(operation: str, version: str): |
| 861 | """ |
| 862 | Compares the current Nvidia ModelOpt version to a given reference with an operation. |
| 863 | |
| 864 | Args: |
| 865 | operation (`str`): |
| 866 | A string representation of an operator, such as `">"` or `"<="` |
| 867 | version (`str`): |
| 868 | A version string |
| 869 | """ |
| 870 | if not _nvidia_modelopt_available: |
| 871 | return False |
| 872 | return compare_versions(parse(_nvidia_modelopt_version), operation, version) |
| 873 | |
| 874 | |
| 875 | @cache |
searching dependent graphs…