特性開關 (Python)¶
穩定 API¶
- class fbgemm_gpu.config.FeatureGateName(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
FBGEMM_GPU 特性開關列舉 (Python)。
程式碼示例
from fbgemm_gpu.config import FeatureGateName def foo(): if FeatureGateName.TBE_V2.is_enabled(): # Do something if feature is enabled ... else: # Do something different if feature is disabled ...
注意
雖然不是必需的,但最好在 C++ 中(位於 fbgemm_gpu/config/feature_gates.h)映象這些列舉值。
對於 fbcode:列舉名稱必須與 UI 中的 JK knob 名稱完全匹配。對於開源版本 (OSS):環境變數將被解析為 f”FBGEMM_{ENUM}”