diff --git a/mindspore/core/ops/gather_nd.cc b/mindspore/core/ops/gather_nd.cc index cafbf662549..62ea77bf7df 100644 --- a/mindspore/core/ops/gather_nd.cc +++ b/mindspore/core/ops/gather_nd.cc @@ -37,13 +37,6 @@ abstract::ShapePtr GatherNdInferShape(const PrimitivePtr &primitive, const std:: } auto input_rank = input_shape.size(); auto indices_rank = indices_shape.size(); - if (IsDynamic(input_shape)) { - ShapeVector output_shape_dyn; - for (size_t i = LongToSize(indices_shape[indices_rank - 1]); i < input_rank; ++i) { - output_shape_dyn.push_back(abstract::Shape::kShapeDimAny); - } - return std::make_shared(output_shape_dyn); - } (void)CheckAndConvertUtils::CheckInteger("Input of indices data", SizeToLong(input_rank), kGreaterEqual, indices_shape[indices_rank - 1], prim_name); std::vector output_shape;