Skip to content

Commit a5c89ee

Browse files
committed
fix tensorcopy
1 parent 374d3da commit a5c89ee

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

paddle/pten/kernels/impl/expand_grad_kernel_impl.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ void ExpandGradKernel(const Context& ctx,
8888
}
8989
// no need reduce, just copy
9090
if (just_copy) {
91-
ctx.template Alloc<T>(in_grad);
92-
pten::Copy(ctx, x, false, in_grad);
91+
pten::Copy(ctx, out_grad, false, in_grad);
9392
} else {
9493
PADDLE_ENFORCE_GE(dims,
9594
1,

0 commit comments

Comments
 (0)