forked from mindspore-Ecosystem/mindspore
[MS][LITE][r1.9] fuzz fix 0923
This commit is contained in:
parent
5b1d5d4097
commit
be152cfc31
|
@ -78,6 +78,15 @@ int SplitBaseCPUKernel::CheckAndInitSplitParam(const lite::Tensor &in_tensor, Sp
|
|||
for (int i = 0; i < param->num_split_; i++) {
|
||||
param->split_sizes_[i] = split_size;
|
||||
}
|
||||
} else {
|
||||
int64_t split_sizes_sum = 0;
|
||||
for (int i = 0; i < param->num_split_; i++) {
|
||||
split_sizes_sum += param->split_sizes_[i];
|
||||
}
|
||||
if (split_sizes_sum > input_shape[param->split_dim_]) {
|
||||
MS_LOG(ERROR) << "Customer-based split sizes is not usable.";
|
||||
return RET_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
if (param->split_sizes_[param->num_split_ - 1] == -1) {
|
||||
|
|
|
@ -75,6 +75,13 @@ int TileCPUKernel::ReSize() {
|
|||
ComputeStrides(tile_parameter_->in_shape_, tile_parameter_->in_strides_, tile_parameter_->in_dim_);
|
||||
ComputeStrides(tile_parameter_->out_shape_, tile_parameter_->out_strides_, tile_parameter_->in_dim_);
|
||||
|
||||
for (size_t i = 0; i < tile_parameter_->dims_size_; i++) {
|
||||
MS_CHECK_FALSE(INT_MUL_OVERFLOW(tile_parameter_->multiples_[i], tile_parameter_->in_shape_[i]),
|
||||
NNACL_ERRCODE_MUL_OVERFLOW);
|
||||
auto ele_num = tile_parameter_->multiples_[i] * tile_parameter_->in_shape_[i] - 1;
|
||||
MS_CHECK_FALSE(INT_MUL_OVERFLOW(tile_parameter_->out_strides_[i], ele_num), NNACL_ERRCODE_MUL_OVERFLOW);
|
||||
}
|
||||
|
||||
auto data_type = in_tensors_.at(0)->data_type();
|
||||
if (data_type == kNumberTypeFloat32 || data_type == kNumberTypeInt32) {
|
||||
tile_parameter_->data_size_ = sizeof(float);
|
||||
|
|
|
@ -28,6 +28,11 @@ int EmbeddingLookupCPUKernel::Prepare() {
|
|||
CHECK_LESS_RETURN(in_tensors_.size(), 1);
|
||||
CHECK_LESS_RETURN(out_tensors_.size(), 1);
|
||||
CHECK_NULL_RETURN(param_);
|
||||
auto ids_data_type = in_tensors_.back()->data_type();
|
||||
if (ids_data_type != kNumberTypeInt32 && ids_data_type != kNumberTypeInt64) {
|
||||
MS_LOG(ERROR) << "embedding_lookup not support input_indices data type: " << ids_data_type;
|
||||
return RET_ERROR;
|
||||
}
|
||||
if (!InferShapeDone()) {
|
||||
return RET_OK;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue