Skip to content

Commit

Permalink
修改错误状态码
Browse files Browse the repository at this point in the history
  • Loading branch information
zjhellofss committed Jun 16, 2024
1 parent a670f6b commit 0d36f12
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions kuiper/source/op/layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ base::Status Layer::check_tensor(const tensor::Tensor& tensor,
return base::error::InvalidArgument("The tensor parameter is empty.");
}
if (tensor.device_type() != device_type) {
return base::error::InternalError("The tensor has a wrong device type.");
return base::error::InvalidArgument("The tensor has a wrong device type.");
}
if (tensor.data_type() != data_type) {
return base::error::InternalError("The tensor has a wrong data type.");
return base::error::InvalidArgument("The tensor has a wrong data type.");
}
return base::error::Success();
}
Expand All @@ -72,18 +72,18 @@ base::Status Layer::check_tensor_with_dim(const tensor::Tensor& tensor,
return base::error::InvalidArgument("The tensor parameter is empty.");
}
if (tensor.device_type() != device_type) {
return base::error::InternalError("The tensor has a wrong device type.");
return base::error::InvalidArgument("The tensor has a wrong device type.");
}
if (tensor.data_type() != data_type) {
return base::error::InternalError("The tensor has a wrong data type.");
return base::error::InvalidArgument("The tensor has a wrong data type.");
}

va_start(args, data_type);
int32_t dims = tensor.dims_size();
for (int32_t i = 0; i < dims; ++i) {
int32_t dim = va_arg(args, int32_t);
if (dim != tensor.get_dim(i)) {
return base::error::InternalError("The tensor has a wrong dim in dim" +
return base::error::InvalidArgument("The tensor has a wrong dim in dim" +
std::to_string(i));
}
}
Expand Down

0 comments on commit 0d36f12

Please sign in to comment.