forked from mindspore-Ecosystem/mindspore
!49273 Fix dynamic rank bug of reshape
Merge pull request !49273 from chenfei_mindspore/master
This commit is contained in:
commit
fe32b252c5
|
@ -64,6 +64,9 @@ ShapeVector update_shape(const std::vector<int> &padding_axis_value, const Shape
|
||||||
for (int64_t value : shape) {
|
for (int64_t value : shape) {
|
||||||
shape_num = LongMulWithOverflowCheck(value, shape_num);
|
shape_num = LongMulWithOverflowCheck(value, shape_num);
|
||||||
}
|
}
|
||||||
|
if (shape_num == abstract::Shape::kShapeRankAny) {
|
||||||
|
return {abstract::Shape::kShapeRankAny};
|
||||||
|
}
|
||||||
if (shape_num != x_num) {
|
if (shape_num != x_num) {
|
||||||
MS_EXCEPTION(ValueError) << "The accumulate of x_shape must be equal to out_shape, but got x_shape: " << x_shape
|
MS_EXCEPTION(ValueError) << "The accumulate of x_shape must be equal to out_shape, but got x_shape: " << x_shape
|
||||||
<< ", and out_shape: " << shape;
|
<< ", and out_shape: " << shape;
|
||||||
|
|
Loading…
Reference in New Issue