diff --git a/python/paddle/tensor/linalg.py b/python/paddle/tensor/linalg.py index 86ea2307ed4d6d340f4204b0d14631a1dcf71869..7b7adc1eeca9a6ee69ba434cbcb3a69ed1047895 100644 --- a/python/paddle/tensor/linalg.py +++ b/python/paddle/tensor/linalg.py @@ -906,9 +906,13 @@ def cond(x, p=None, name=None): keepdim, 'reduce_all', reduce_all) if porder == 2: + if in_dygraph_mode(): + return _C_ops.divide(max_out, min_out) return _legacy_C_ops.elementwise_div(max_out, min_out, 'aixs', axis, 'use_mkldnn', False) if porder == -2: + if in_dygraph_mode(): + return _C_ops.divide(min_out, max_out) return _legacy_C_ops.elementwise_div(min_out, max_out, 'aixs', axis, 'use_mkldnn', False)