Skip to content

Commit

Permalink
Merge pull request PaddlePaddle#30 from zmxdream/fix_pull_box_extend_…
Browse files Browse the repository at this point in the history
…sparse

fix pull_box_extend_sparse
  • Loading branch information
zmxdream authored Nov 27, 2023
2 parents 82d92c0 + 715b008 commit 19959d0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions paddle/fluid/operators/pull_box_extended_sparse_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ static void PullBoxExtendedSparseFunctor(
reinterpret_cast<const uint64_t*>(slot->data<int64_t>());
all_keys[i] = single_slot_keys;
slot_lengths[i] = slot->numel();
if (outputs[embedx_offset]->numel() == 0) {
outputs[embedx_offset]->set_layout(paddle::framework::DataLayout::UNDEFINED);
if (outputs[i]->numel() == 0) {
outputs[i]->set_layout(paddle::framework::DataLayout::UNDEFINED);
} else {
size_t offset = slot_dims0_offset[i] * dims1 * sizeof(T);
total_values.set_offset(offset);
outputs[i]->ShareBufferWith(total_values);
}
auto *output = outputs[i]->mutable_data<T>(ctx.GetPlace());
all_values[i] = reinterpret_cast<float*>(output);
if(outputs_extend[expand_offset]->numel()==0) {
outputs_extend[expand_offset]->set_layout(paddle::framework::DataLayout::UNDEFINED);
if(outputs_extend[i]->numel() == 0) {
outputs_extend[i]->set_layout(paddle::framework::DataLayout::UNDEFINED);
} else {
size_t offset = slot_dims0_offset[i] * expand_dims1 * sizeof(T);
total_values.set_offset(max_total_dims0 * dims1 * sizeof(T) + offset);
Expand Down

0 comments on commit 19959d0

Please sign in to comment.