!49069 [MS]修复SparseSoftmaxCrossEntropyWithLogitsV2算子fuzz crash

Merge pull request !49069 from zhuguodong/for_cross_op
This commit is contained in:
i-robot 2023-02-20 12:15:41 +00:00 committed by Gitee
commit d36d61b744
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 3 additions and 2 deletions

View File

@ -38,11 +38,12 @@ abstract::TupleShapePtr SparseSoftmaxCrossEntropyWithLogitsV2InferShape(
if (!IsDynamic(features_shape)) { if (!IsDynamic(features_shape)) {
(void)CheckAndConvertUtils::CheckInteger("dimension of labels", SizeToLong(labels_shape.size()), kEqual, (void)CheckAndConvertUtils::CheckInteger("dimension of labels", SizeToLong(labels_shape.size()), kEqual,
labels_rank, op_name); labels_rank, op_name);
(void)CheckAndConvertUtils::CheckInteger("dimension of logits(features)", SizeToLong(features_shape.size()), kEqual,
features_rank, op_name);
(void)CheckAndConvertUtils::CheckInteger("batch of logits(features)", features_shape[kInputIndex0], kEqual, (void)CheckAndConvertUtils::CheckInteger("batch of logits(features)", features_shape[kInputIndex0], kEqual,
labels_shape[kInputIndex0], op_name); labels_shape[kInputIndex0], op_name);
} }
(void)CheckAndConvertUtils::CheckInteger("dimension of logits(features)", SizeToLong(features_shape.size()), kEqual,
features_rank, op_name);
auto loss_shape = labels_shape; auto loss_shape = labels_shape;
auto backprop_shape = features_shape; auto backprop_shape = features_shape;
abstract::ShapePtr loss_shape_ptr, backprop_shape_ptr; abstract::ShapePtr loss_shape_ptr, backprop_shape_ptr;