Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion custom_ops/xpu_ops/src/ops/moe_expert_ffn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
Loading