未验证 提交 9045b882 编写于 作者: W Weilong Wu 提交者: GitHub

fix python syntax issue (#51658)

上级 1fbf423a
......@@ -481,25 +481,25 @@ def _set_prim_forward_blacklist(ops=None):
def _set_prim_backward_enabled(value):
__set_bwd_prim_enabled(bool(value))
if os.getenv("FLAGS_prim_log") is "1":
if os.getenv("FLAGS_prim_log") == "1":
print("backward prim enabled: ", bool(_is_bwd_prim_enabled()))
def _set_prim_forward_enabled(value):
__set_fwd_prim_enabled(bool(value))
if os.getenv("FLAGS_prim_log") is "1":
if os.getenv("FLAGS_prim_log") == "1":
print("forward prim enabled: ", bool(_is_fwd_prim_enabled()))
def set_prim_eager_enabled(value):
__set_eager_prim_enabled(bool(value))
if os.getenv("FLAGS_prim_log") is "1":
if os.getenv("FLAGS_prim_log") == "1":
print("eager prim enabled: ", bool(_is_eager_prim_enabled()))
def _set_prim_all_enabled(value):
__set_all_prim_enabled(bool(value))
if os.getenv("FLAGS_prim_log") is "1":
if os.getenv("FLAGS_prim_log") == "1":
print(
"all prim enabled: ",
bool(_is_fwd_prim_enabled() and _is_bwd_prim_enabled()),
......@@ -509,7 +509,7 @@ def _set_prim_all_enabled(value):
def __sync_prim_backward_status():
flag_value = os.getenv("FLAGS_prim_backward")
if flag_value is None:
if os.getenv("FLAGS_prim_log") is "1":
if os.getenv("FLAGS_prim_log") == "1":
print("backward prim enabled: ", bool(_is_bwd_prim_enabled()))
else:
__sync_stat_with_flag("FLAGS_prim_backward")
......@@ -518,7 +518,7 @@ def __sync_prim_backward_status():
def __sync_prim_forward_status():
flag_value = os.getenv("FLAGS_prim_forward")
if flag_value is None:
if os.getenv("FLAGS_prim_log") is 1:
if os.getenv("FLAGS_prim_log") == "1":
print("forward prim enabled: ", bool(_is_fwd_prim_enabled()))
else:
__sync_stat_with_flag("FLAGS_prim_forward")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册