mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-16 05:30:58 +08:00
Upgrade FDASSERT (#97)
* upgrade FDASSERT * Optimize error message of FDTensor function * upgrade FDASSERT Co-authored-by: Jason <jiangjiajun@baidu.com>
This commit is contained in:
@@ -114,8 +114,11 @@ void SoftmaxKernel(const FDTensor& x, FDTensor* out, int axis) {
|
||||
}
|
||||
|
||||
void Softmax(const FDTensor& x, FDTensor* out, int axis) {
|
||||
FDASSERT(std::abs(axis) < x.shape.size(),
|
||||
"The given axis should be smaller than the input's dimension");
|
||||
FDASSERT(
|
||||
std::abs(axis) < x.shape.size(),
|
||||
"The absolute given axis should be smaller than the input's "
|
||||
"dimension. Expected absolute axis is smaller than %d, but receive %d.",
|
||||
x.shape.size(), std::abs(axis));
|
||||
FD_VISIT_FLOAT_TYPES(x.dtype, "SoftmaxKernel",
|
||||
([&] { SoftmaxKernel<data_t>(x, out, axis); }));
|
||||
}
|
||||
|
Reference in New Issue
Block a user