Skip to content

[BUG] mx.load misinterprets dtype as complex64 instead of float64 #2958

@krishi-saripalli

Description

@krishi-saripalli

Describe the bug
mx.load() appears to misinterpret the datatype of .npy files with 64-bit data as complex64 when it should be float64.

To Reproduce

Include code snippet

>>> import numpy as np
>>> import mlx.core as mx
>>> data = np.load("my_data.npy")
>>> print(f"Dtype: {data.dtype}")
Dtype: float64
>>> mx_data = mx.load("my_data.npy")
>>> print(f"Dtype: {mx_data.dtype}")
Dtype: mlx.core.complex64
>>> 

Expected behavior
Like numpy, the data should be correctly loaded as float64

Desktop (please complete the following information):

  • OS Version: MacOS 15.6
  • Version 0.30.1

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions