mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-12-24 13:28:13 +08:00
[XPU] Fix the error in MoeExpertFFN operator when valid_token_num=0 (#5196)
This commit is contained in:
@@ -441,7 +441,7 @@ std::vector<paddle::Tensor> MoeExpertFFN(
|
||||
const std::string& quant_method,
|
||||
const int hadamard_blocksize,
|
||||
const int valid_token_num) {
|
||||
if (ffn_in.numel() == 0) {
|
||||
if (ffn_in.numel() == 0 || valid_token_num == 0) {
|
||||
paddle::Tensor ffn2_out =
|
||||
paddle::empty_like(ffn_in, paddle::DataType::BFLOAT16);
|
||||
return {ffn2_out};
|
||||
|
||||
Reference in New Issue
Block a user