save
Function
Saves data to the specified path.
Format
mindio_acp.save(obj, path, open_way='memfs')
Parameters
Parameter |
Mandatory/Optional |
Description |
Value |
|---|---|---|---|
obj |
Mandatory |
Object to be saved |
Valid data object |
path |
Mandatory |
Data storage path |
Valid file path |
open_way |
Optional |
Saving mode.
memfs is used by default. |
|
Usage Example
>>> # Save to file >>> x = torch.tensor([0, 1, 2, 3, 4]) >>> mindio_acp.save(x, '/mnt/dpc01/tensor.pt')
Return Value
- -1: Data saving fails.
- 0: Save data using the native torch.save mode.
- 1: Save data using the memfs mode.
- 2: Save data using the fopen mode.
Parent topic: API Reference