Skip to content

Commit 757620d

Browse files
modify setvalue 0-size part
1 parent 77a8785 commit 757620d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

paddle/phi/kernels/gpu/set_value_kernel.cu

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ void SetTensorValueKernelV2(const Context& dev_ctx,
7979
&new_out_stride);
8080

8181
if (product(phi::make_ddim(new_out_shape)) <= 0) {
82-
// 0-size tensor, no need to copy
82+
out->ResetHolder(in.Holder());
83+
out->ShareInplaceVersionCounterWith(in);
8384
return;
8485
}
8586

0 commit comments

Comments
 (0)