Core Dump Occurs When the Tensor and Image Memory Data on the Device Is Printed

Symptom

When data of the Tensor and Image classes is stored on the device, a core dump occurs when the GetData() API is called to return a pointer and print the data pointed by the pointer.

Cause Analysis

The address space on the device is independent of that on the host. The host cannot directly access the data on the device. For details, see the CANN Application Development Guide (C&C++).

Solution

Use Tensor.ToHost() or Image.ToHost() to transfer data of the Tensor or Image class from the device to the host, and then print the data again.