mlx-examples icon indicating copy to clipboard operation
mlx-examples copied to clipboard

Checking for nan values in arrays

Open sck-at-ucy opened this issue 6 months ago • 2 comments

I have run into a situation where my code continues to run for some time while nan values start to appear in mx arrays. I want to catch this early and do exception handling. In situations like this having the equivalent of NumPy'sisnan(), e.g.

if mx.any(mx.isnan(u))

would be very handy. I am not sure if something is already available and missed it.

sck-at-ucy avatar Jan 04 '24 21:01 sck-at-ucy