From 0f77e316917b1456170b15350cd5928ca73bcf0c Mon Sep 17 00:00:00 2001 From: Liufang Sang Date: Sat, 25 Apr 2020 21:08:23 -0500 Subject: [PATCH] fix error when out is not None test=develop (#24103) --- python/paddle/tensor/stat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/paddle/tensor/stat.py b/python/paddle/tensor/stat.py index 57a498b52dd..7275dc3242f 100644 --- a/python/paddle/tensor/stat.py +++ b/python/paddle/tensor/stat.py @@ -151,7 +151,7 @@ def std(input, axis=None, keepdim=False, unbiased=True, out=None, name=None): tmp = var(input, axis=axis, keepdim=keepdim, unbiased=unbiased, name=name) tmp = layers.sqrt(tmp) - if out: + if out is not None: layers.assign(input=tmp, output=out) return out else: -- GitLab