From b158a21bda83a8a2407655e7ae8d7760f383788f Mon Sep 17 00:00:00 2001 From: LutaoChu <30695251+LutaoChu@users.noreply.github.com> Date: Mon, 27 Jul 2020 15:54:55 +0800 Subject: [PATCH] fix bug: cross OP behavior is not as expected when axis=0 fix the cross OP behavior is not as expected when axis=0 --- python/paddle/tensor/linalg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/paddle/tensor/linalg.py b/python/paddle/tensor/linalg.py index 7ec68dc8980..6b67394b6bd 100644 --- a/python/paddle/tensor/linalg.py +++ b/python/paddle/tensor/linalg.py @@ -632,7 +632,7 @@ def cross(x, y, axis=None, name=None): # [0. 0. 0.]] """ if in_dygraph_mode(): - if axis: + if axis is not None: return core.ops.cross(x, y, 'dim', axis) else: return core.ops.cross(x, y) -- GitLab