MCPcopy Create free account
hub / github.com/pytorch/executorch / _normalize_cmake_bool

Function _normalize_cmake_bool

install_utils.py:114–122  ·  view source on GitHub ↗
(value: Optional[str], default: bool = False)

Source from the content-addressed store, hash-verified

112
113
114def _normalize_cmake_bool(value: Optional[str], default: bool = False) -> bool:
115 if value is None:
116 return default
117 normalized = value.strip().upper()
118 if normalized in {"ON", "1", "TRUE", "YES"}:
119 return True
120 if normalized in {"OFF", "0", "FALSE", "NO"}:
121 return False
122 return default
123
124
125def _cuda_version_to_pytorch_suffix(major, minor):

Callers 1

is_cmake_option_onFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected