From 657053f262278a2cf7d6510bcd4d74b9d9483a61 Mon Sep 17 00:00:00 2001 From: danleifeng <52735331+danleifeng@users.noreply.github.com> Date: Thu, 5 Dec 2019 19:14:16 +0800 Subject: [PATCH] remove elementwise x_should_larger_than_y restriction;test=develop (#21517) --- python/paddle/fluid/layers/math_op_patch.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/python/paddle/fluid/layers/math_op_patch.py b/python/paddle/fluid/layers/math_op_patch.py index a81f3085b1f..be7bf69c302 100644 --- a/python/paddle/fluid/layers/math_op_patch.py +++ b/python/paddle/fluid/layers/math_op_patch.py @@ -226,20 +226,12 @@ def monkey_patch_variable(): out = create_new_tmp_var(current_block(self), dtype=lhs_dtype) - axis = -1 - if other_var.shape[0] == -1: - axis = 0 - assert len(self.shape) >= len(other_var.shape), ( - "The rank of the first argument of an binary operator cannot " - "be smaller than the rank of its second argument: %s vs %s" % - (len(self.shape), len(other_var.shape))) - current_block(self).append_op( type=op_type, inputs={'X': [self], 'Y': [other_var]}, outputs={'Out': out}, - attrs={'axis': axis}) + attrs={'axis': -1}) return out comment = OpProtoHolder.instance().get_op_proto(op_type).comment -- GitLab