功能门 (Python)¶
稳定版 API¶
- class fbgemm_gpu.config.FeatureGateName(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[源代码]¶
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:ENUM 名称必须与 UI 中的 JK 旋钮名称完全匹配。对于 OSS:环境变量将被评估为 f”FBGEMM_{ENUM}”