diff --git a/python/paddle/fluid/core.py b/python/paddle/fluid/core.py index 1793d06ce2aba1ba9bf63ec2906caa0b75b35ce7..508532e51e83ac26b26017394bd8deca0427d849 100644 --- a/python/paddle/fluid/core.py +++ b/python/paddle/fluid/core.py @@ -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")