Fix the usage of out_grad lod in sequence_slice_op. (#17625)

test=develop
dependabot/pip/python/requests-2.20.0
Guo Sheng 6 years ago committed by GitHub
parent afc3d85da2
commit 430e25654b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -135,7 +135,8 @@ class SequenceSliceGradOpKernel : public framework::OpKernel<T> {
}
auto lod = in->lod();
auto out_lod = out_grad->lod();
// to avoid out_grad missing lod, compute lod again
auto out_lod = SequenceSliceLoD(*in, offset_data, length_data);
if (x_grad) {
x_grad->mutable_data<T>(ctx.GetPlace());

Loading…
Cancel
Save