# C++ NDArray::CopyFrom Not Synchronized

**URL:** <https://discuss.tvm.apache.org/t/c-ndarray-copyfrom-not-synchronized/13779>\
**Category:** Troubleshooting\
**Created:** [October 22, 2022, 6:39am UTC](https://discuss.tvm.apache.org/t/c-ndarray-copyfrom-not-synchronized/13779 "2022-10-22T06:39:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chenjunweii](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/chenjunweii/32/294_2.png) [@chenjunweii](https://discuss.tvm.apache.org/u/chenjunweii)\
**Post date:** [October 22, 2022, 6:39am UTC](https://discuss.tvm.apache.org/t/c-ndarray-copyfrom-not-synchronized/13779/1 "2022-10-22T06:39:59Z")

</div>

Hi Guys

I would like to copy data from CPU to GPU

After inference the result is different every time, I think the problem is that the data do not copy completely, I also tried TVMSynchronize () … but still not working

Any Ideas ?

```auto
nds[node] = tvm::runtime::NDArray::Empty(shape, DLDataType{ kDLFloat , 32, 1 }, device);
nds_cpu[node] = tvm::runtime::NDArray::Empty(shape, DLDataType{ kDLFloat , 32, 1 }, device_cpu);
set_val(nds_cpu[node]);
nds[node].CopyFrom(nds_cpu[node]);

```

---

<div class="post-metadata">

**Author:** ![chenjunweii](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/chenjunweii/32/294_2.png) [@chenjunweii](https://discuss.tvm.apache.org/u/chenjunweii)\
**Post date:** [November 4, 2022, 8:26am UTC](https://discuss.tvm.apache.org/t/c-ndarray-copyfrom-not-synchronized/13779/2 "2022-11-04T08:26:11Z")

</div>

Is there any solution ?
