Skip to content

Commit 46d7c38

Browse files
committed
refine error message
1 parent 102cbca commit 46d7c38

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

onnxruntime/core/providers/cpu/nn/layer_norm_helper.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
2-
// Copyright (c) 2023 NVIDIA Corporation.
32
// Licensed under the MIT License.
43

54
#pragma once
5+
66
#include "core/framework/tensor_shape.h"
77
#include "core/common/status.h"
88

99
namespace onnxruntime {
1010

1111
constexpr const char* kLayerNormInputShapeMismatchError =
12-
"Size of scale and bias (if provided) must match X.shape()[axis:], "
13-
"or scale and bias shape are same and can be broadcasted to X when axis is 2. ";
12+
"Size of scale and bias (if provided) must match X.shape[axis:], "
13+
"or scale and bias (with same shape) can be broadcasted to X when axis is 2.";
1414

15-
constexpr const char* kLayerNormInvalidSize = "Size of X.shape()[axis:] must be larger than 1, got ";
15+
constexpr const char* kLayerNormInvalidSize = "Size of X.shape[axis:] must be larger than 1, got ";
1616

1717
class LayerNormHelper {
1818
public:
@@ -26,7 +26,10 @@ class LayerNormHelper {
2626
if (broadcast_param == 0) {
2727
return ORT_MAKE_STATUS(ONNXRUNTIME, INVALID_ARGUMENT,
2828
kLayerNormInputShapeMismatchError,
29-
"Shapes X=", x_shape, " scale=", scale_shape, " bias=", bias_shape, " and axis=", axis);
29+
" X.shape=", x_shape,
30+
" scale.shape=", scale_shape,
31+
" bias.shape=", bias_shape,
32+
" and axis=", axis);
3033
}
3134

3235
return Status::OK();

0 commit comments

Comments
 (0)