mirror of
https://github.com/ml-explore/mlx.git
synced 2025-11-05 11:28:12 +08:00
typing: add type hints to mlx.core.array, linalg, distributed, and random (#2565)
* Add type annotations to mlx methods * Missing list_or_scalar
This commit is contained in:
@@ -9,6 +9,7 @@ mlx.core.__prefix__:
|
||||
mlx.core.__suffix__:
|
||||
from typing import Union
|
||||
scalar: TypeAlias = Union[int, float, bool]
|
||||
list_or_scalar: TypeAlias = Union[scalar, list["list_or_scalar"]]
|
||||
bool_: Dtype = ...
|
||||
|
||||
mlx.core.distributed.__prefix__:
|
||||
@@ -29,5 +30,5 @@ mlx.core.metal.__prefix__:
|
||||
from typing import Sequence, Optional, Union
|
||||
|
||||
mlx.core.random.__prefix__:
|
||||
from mlx.core import array, Dtype, Device, Stream, scalar
|
||||
from mlx.core import array, Dtype, Device, Stream, scalar, float32, int32
|
||||
from typing import Sequence, Optional, Union
|
||||
|
||||
Reference in New Issue
Block a user