Print

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product AI Core

Atlas inference product Vector Core

Atlas training product

Function Usage

Prints LocalTensor data in the debugging window for precision debugging. Each line contains one data block (32 bytes). This API is used only for CPU debugging.

Prototype

1
2
inline void Print()
inline void Print(uint32_t len)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

len

Input

Number of elements to be printed.

Returns

None

Restrictions

None

Examples

1
2
3
4
5
6
7
8
// Example: Used only for CPU debugging. Print LocalTensor data in the debugging window for precision debugging. Each line contains one data block (32 bytes).
AscendC::LocalTensor<int32_t> inputLocal = softmaxMaxBuf.template Get<int32_t>();
for (int32_t i = 0; i < 16; ++i) {
    inputLocal.SetValue(i, i); // Assign i to the ith position in input_local.
}
inputLocal.Print();
// 0000: 0 1 2 3 4 5 6 7 8
// 0008: 9 10 11 12 13 14 15