Skip to content

Commit 91e10fb

Browse files
authored
Merge pull request #13130 from dzhwinter/picked/shrink_memory
"fix style" (#13094)
2 parents 90fbc19 + 76b0a38 commit 91e10fb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

paddle/fluid/operators/shrink_rnn_memory_op.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ class ShrinkRNNMemoryOp : public ArrayOp {
6262
}
6363

6464
if (dst_num_rows != 0) {
65-
out_tensor.ShareDataWith(x_tensor.Slice(0, height));
65+
out_tensor.mutable_data(place, x_tensor.type());
66+
auto dev_ctx = platform::DeviceContextPool::Instance().Get(place);
67+
framework::TensorCopy(x_tensor.Slice(0, height), place, *dev_ctx,
68+
&out_tensor);
6669
}
6770
}
6871
};

0 commit comments

Comments
 (0)