load

Function

Loads the persistent object of the save or multi_save API from a file.

Format

mindio_acp.load(path, open_way='memfs', map_location=None)

Parameters

Parameter

Mandatory/Optional

Description

Value

path

Mandatory

Loading path

Valid file path

open_way

Optional

Loading mode.

  • memfs: uses the high-performance MemFS of MindIO ACP to store data.
  • fopen: calls file operation functions in the C standard library to save data. It is usually used as a backup of the memfs mode.

memfs is used by default.

  • memfs
  • fopen

map_location

Optional

Device to be mapped during loading. None is used by default.

  • None
  • cpu

Usage Example

>>> # load from file
>>> mindio_acp.load('/mnt/dpc01/checkpoint/rank-0.pt')

Return Value

Any

Similar to the load API of PyTorch, this API also uses the pickle module, which may be attacked through maliciously constructed data during unpickle. Ensure that the source of the data to be loaded is secure. Only trusted data can be loaded.