ToFile

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

Dumps LocalTensor data to a file that is stored in the execution directory for precision debugging. This API is used only for CPU debugging.

Prototype

1
int32_t ToFile(const std::string& fileName) const

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

fileName

Input

Name of the file to be saved.

Returns

0 on success; else, failure.

Restrictions

None

Examples

1
2
3
// Example: Only for CPU debugging. Dump LocalTensor data to a file that is stored in the execution directory for precision debugging.
AscendC::LocalTensor<float> tmpTensor = softmaxMaxBuf.template Get<float>();
tmpTensor.ToFile("tmpTensor.bin");