mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-16 01:49:05 +08:00
Fix mx.core.load type annotation (#2819)
This commit is contained in:
@@ -4021,7 +4021,7 @@ void init_ops(nb::module_& m) {
|
|||||||
nb::kw_only(),
|
nb::kw_only(),
|
||||||
"stream"_a = nb::none(),
|
"stream"_a = nb::none(),
|
||||||
nb::sig(
|
nb::sig(
|
||||||
"def load(file: Union[file, str, pathlib.Path], /, format: Optional[str] = None, return_metadata: bool = False, *, stream: Union[None, Stream, Device] = None) -> Union[array, dict[str, array]]"),
|
"def load(file: Union[file, str, pathlib.Path], /, format: Optional[str] = None, return_metadata: bool = False, *, stream: Union[None, Stream, Device] = None) -> Union[array, dict[str, array], Tuple[dict[str, array], dict[str, Any]]]"),
|
||||||
R"pbdoc(
|
R"pbdoc(
|
||||||
Load array(s) from a binary file.
|
Load array(s) from a binary file.
|
||||||
|
|
||||||
@@ -4037,11 +4037,12 @@ void init_ops(nb::module_& m) {
|
|||||||
which support matadata. The metadata will be returned as an
|
which support matadata. The metadata will be returned as an
|
||||||
additional dictionary. Default: ``False``.
|
additional dictionary. Default: ``False``.
|
||||||
Returns:
|
Returns:
|
||||||
array or dict:
|
array, dict, or tuple:
|
||||||
A single array if loading from a ``.npy`` file or a dict
|
A single array if loading from a ``.npy`` file or a dict
|
||||||
mapping names to arrays if loading from a ``.npz`` or
|
mapping names to arrays if loading from a ``.npz`` or
|
||||||
``.safetensors`` file. If ``return_metadata`` is ``True`` an
|
``.safetensors`` file. If ``return_metadata`` is ``True`` a
|
||||||
additional dictionary of metadata will be returned.
|
tuple ``(arrays, metadata)`` will be returned where the second
|
||||||
|
element is a dictionary containing the metadata.
|
||||||
|
|
||||||
Warning:
|
Warning:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user