ToFile
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
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
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"); |
Parent topic: LocalTensor