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

Function _version_ok

tools/Polygraphy/polygraphy/mod/importer.py:45–58  ·  view source on GitHub ↗
(ver, preferred)

Source from the content-addressed store, hash-verified

43
44
45def _version_ok(ver, preferred):
46 if preferred == LATEST_VERSION:
47 return False
48
49 pref_ver = preferred.lstrip("<=>").strip()
50 cond = preferred.rstrip(pref_ver).strip()
51 check = {
52 "==": lambda x, y: x == y,
53 ">=": lambda x, y: x >= y,
54 ">": lambda x, y: x > y,
55 "<=": lambda x, y: x <= y,
56 "<": lambda x, y: x < y,
57 }[cond]
58 return check(mod_util.version(ver), mod_util.version(pref_ver))
59
60
61def lazy_import(

Calls 1

checkFunction · 0.85