open_file

This API supports only the MindSpore framework.

Function

with is used to call open_file to open a file in read-only mode and return the corresponding _ReadableFileWrapper instance. The instance provides the read() and close() methods.

Format

mindio_acp.open_file(path: str)

Parameters

Parameter

Mandatory/Optional

Description

Value

path

Mandatory

Loading path

Valid file path

Usage Example

>>> with mindio_acp.open_file('/mnt/dpc01/checkpoint/rank-0.pt') as f:
...     read_data = f.read()

Return Value

_ReadableFileWrapper instance.

For details, see MindSpore documentation.