Skip to content

enhance the version comparison utililty #2479

@wyli

Description

@wyli

Is your feature request related to a problem? Please describe.
version comparison is needed for a few cases:

  • MONAI/tests/utils.py

    Lines 133 to 136 in 2085a49

    if has_pkg_res:
    self.version_too_new = ver(torch.__version__) >= ver(".".join(map(str, self.max_version)))
    else:
    self.version_too_new = get_torch_version_tuple() >= self.max_version
  • MONAI/monai/utils/module.py

    Lines 276 to 279 in 2085a49

    if has_ver:
    PT_BEFORE_1_7 = ver(torch.__version__) < ver("1.7")
    else:
    PT_BEFORE_1_7 = get_torch_version_tuple() < (1, 7)
  • # parse the version strings in this basic way to avoid needing the `packaging` package

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions