diff --git a/python/paddle/tensor/linalg.py b/python/paddle/tensor/linalg.py index 7ec68dc8980a1e57059c1ee2f01990250d7dabc8..6b67394b6bd250282e2ea8f13134503ac6cbfc0a 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)