How to get the NDArray in the C++ files

I want to get the value of variables with the NDArray data structure in the C++ files, such as the recv_buf in PullImpl() function in kvstore_dist.h (shown in the following figure). 39 . Anyone gives me some suggestions? Thank your.

To copy a NDArray you can use the SyncCopyToCPU() function see the docs here:

Thank you, Thomas. Got it.

If I want to print the NDArray datatype on the screen in the C++ files, what should I do? The python implementation is easy, but I have no idea on the C++ implementation.