Skip to content

[BUG] mlx.core.random.randint always returns the same value #429

Description

@Redempt1onzzZZ

Describe the bug
When I use ''mlx.core.random.randint'' to generate random integers from the given interval, I notice that every time I run test.py, mlx.core.random.randint always returns the same value

To Reproduce

Include code snippet

import mlx.core as mx
a = mx.random.randint(0, 65535, shape=(2, 2), dtype=mx.uint64)
print(a)

image

Expected behavior
Each run of the program should output a different random array

Desktop (please complete the following information):

  • OS Version: MacOS 14.2.1
  • Version 0.7.0

Additional context
The problem still exists when I construct multiple arrays

import mlx.core as mx
a = mx.random.randint(0, 65535, shape=(2, 2), dtype=mx.uint64)
print(a)
b = mx.random.randint(0, 255, shape=(2, 2), dtype=mx.uint8)
print(b)

image

Metadata

Metadata

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