Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xingmingyyj committed Jan 3, 2024
1 parent 394787e commit d550369
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
9 changes: 9 additions & 0 deletions paddle/phi/infermeta/backward.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,15 @@ void ScatterNdAddGradInferMeta(const MetaTensor& index,
}
}

void ShuffleBatchGradInferMeta(const MetaTensor& shuffle_idx,
const MetaTensor& out_grad,
int startup_seed,
MetaTensor* x_grad) {
x_grad->share_dims(out_grad);
x_grad->share_lod(out_grad);
x_grad->set_dtype(out_grad.dtype());
}

void SpectralNormGradInferMeta(const MetaTensor& weight,
const MetaTensor& u,
const MetaTensor& v,
Expand Down
5 changes: 5 additions & 0 deletions paddle/phi/infermeta/backward.h
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,11 @@ void ScatterNdAddGradInferMeta(const MetaTensor& index,
MetaTensor* x_grad,
MetaTensor* updates_grad);

void ShuffleBatchGradInferMeta(const MetaTensor& shuffle_idx,
const MetaTensor& out_grad,
int startup_seed,
MetaTensor* x_grad);

void SpectralNormGradInferMeta(const MetaTensor& weight,
const MetaTensor& u,
const MetaTensor& v,
Expand Down
8 changes: 0 additions & 8 deletions paddle/phi/infermeta/binary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2750,14 +2750,6 @@ void ShuffleBatchInferMeta(const MetaTensor& x,
shuffle_idx->set_dims(phi::make_ddim({-1}));
}

void ShuffleBatchGradInferMeta(const MetaTensor& shuffle_idx,
const MetaTensor& out_grad,
int startup_seed,
MetaTensor* x_grad) {
x_grad->share_dims(out_grad);
x_grad->share_lod(out_grad);
}

void SequenceMaskInferMeta(const MetaTensor& x,
const MetaTensor& max_len_tensor,
int maxlen,
Expand Down
5 changes: 0 additions & 5 deletions paddle/phi/infermeta/binary.h
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,6 @@ void ShuffleBatchInferMeta(const MetaTensor& x,

);

void ShuffleBatchGradInferMeta(const MetaTensor& shuffle_idx,
const MetaTensor& out_grad,
int startup_seed,
MetaTensor* x_grad);

void SoftmaxMaskFuseInferMeta(const MetaTensor& x,
const MetaTensor& mask,
MetaTensor* out);
Expand Down

0 comments on commit d550369

Please sign in to comment.