MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / version

Function version

tools/Polygraphy/polygraphy/mod/util.py:19–37  ·  view source on GitHub ↗
(version_str)

Source from the content-addressed store, hash-verified

17
18
19def version(version_str):
20 def process_version_part(num):
21 try:
22 return [int(num)]
23 except ValueError:
24 VERSION_SUFFIXES = ["a", "b", "rc", "post", "dev"]
25 # One version part can only contain one of the above suffixes
26 for suffix in VERSION_SUFFIXES:
27 if suffix in num:
28 return num.partition(suffix)
29
30 # For unrecognized suffixes, just return as-is
31 return [num]
32
33 ver_list = []
34 for num in version_str.split("."):
35 ver_list.extend(process_version_part(num))
36
37 return tuple(ver_list)

Callers 2

warn_deprecatedFunction · 0.90
deprecate_implFunction · 0.90

Calls 2

process_version_partFunction · 0.85
extendMethod · 0.45

Tested by

no test coverage detected