From 4a8356b19ab7ce3009837f59800484de4fda7267 Mon Sep 17 00:00:00 2001 From: VectorSL Date: Thu, 28 May 2020 11:56:59 +0800 Subject: [PATCH] check equalcount input shape same --- mindspore/ops/operations/math_ops.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mindspore/ops/operations/math_ops.py b/mindspore/ops/operations/math_ops.py index 9dcebc13b0..d7917b6c7d 100644 --- a/mindspore/ops/operations/math_ops.py +++ b/mindspore/ops/operations/math_ops.py @@ -1415,7 +1415,7 @@ class EqualCount(PrimitiveWithInfer): """ Computes the number of the same elements of two tensors. - The two input tensors should have same data type. + The two input tensors should have same data type and shape. Inputs: - **input_x** (Tensor) - The first input tensor. @@ -1438,6 +1438,7 @@ class EqualCount(PrimitiveWithInfer): self.init_prim_io_names(inputs=['x', 'y'], outputs=['output']) def infer_shape(self, x_shape, y_shape): + validator.check("x_shape", x_shape, "y_shape", y_shape, Rel.EQ, self.name) output_shape = (1,) return output_shape